Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#25 2015-03-13 16:47:24

Bloke
Developer
From: Leeds, UK
Registered: 2006-01-29
Posts: 11,270
Website GitHub

Re: Massive Lag Before Page Load

rossharvey wrote #289029:

Unless it is related to the sheer number of images in the CMS. Then I’m screwed :¬)

Not necessarily. With a tiny bit of core hacking (adding a callback) and a small plugin which I’ve just written (untested yet), we could migrate all your images to sub-folders. Date-based schemes work best for keeping file numbers down:

/images/2014/0925/1.jpg
/images/2014/0925/2.jpg
/images/2014/0928/3.jpg
/images/2015/0604/1397896.jpg
...

Since the image creation date never changes (ha! well, need to check that things stay the same at DST changes), it’s a simple process for the plugin to iterate over your images and move them to the new folders en-masse, and from then on, it’ll keep order on your behalf. Would need thoroughly testing first of course :-) And I’m not sure how well it would play with smd_thumbnail or other image manipulation plugins until they’re tweaked. In theory this little plugin falls back on the /images folder, but if you’ve already moved your images to subfolders, you don’t want another plugin trampling over that and using the base folder for its own stuff.

Anyway, that’s all detail. Bottom line: there’s a solution if it turns out to be the sheer number of files. The first step is ascertaining if that is actually the cause.


The smd plugin menagerie — for when you need one more gribble of power from Textpattern. Bleeding-edge code available on GitHub.

Txp Builders – finely-crafted code, design and Txp

Offline

#26 2015-03-13 17:01:40

rossharvey
Member
From: Earth. Sometimes.
Registered: 2005-03-16
Posts: 233
Website

Re: Massive Lag Before Page Load

Blimey, that was quick Stef, thank you! Sounds like a handy plugin regardless. I’ll be doing some (simple) testing by elimination soon, although it’ll be related to form content only. That’s as far as my TXP debugging ability extends :¬)

Offline

#27 2015-03-13 18:51:05

rossharvey
Member
From: Earth. Sometimes.
Registered: 2005-03-16
Posts: 233
Website

Re: Massive Lag Before Page Load

Bloke wrote #289030:

Not necessarily. With a tiny bit of core hacking (adding a callback) and a small plugin which I’ve just written (untested yet), we could migrate all your images to sub-folders. Date-based schemes work best for keeping file numbers down:

/images/2014/0925/1.jpg...

Since the image creation date never changes (ha! well, need to check that things stay the same at DST changes), it’s a simple process for the plugin to iterate over your images and move them to the new folders en-masse, and from then on, it’ll keep order on your behalf. Would need thoroughly testing first of course :-) And I’m not sure how well it would play with smd_thumbnail or other image manipulation plugins until they’re tweaked. In theory this little plugin falls back on the /images folder, but if you’ve already moved your images to subfolders, you don’t want another plugin trampling over that and using the base folder for its own stuff.

Anyway, that’s all detail. Bottom line: there’s a solution if it turns out to be the sheer number of files. The first step is ascertaining if that is actually the cause.

Would it be easy to test the sub folder theory by moving only one image? The image used in the Holly post that was mentioned in this thread, perhaps?

Offline

#28 2015-03-13 19:27:07

philwareham
Core designer
From: Haslemere, Surrey, UK
Registered: 2009-06-11
Posts: 3,564
Website GitHub Mastodon

Re: Massive Lag Before Page Load

Once the lag thing is resolved, I’d recommend following some of the advice laid out here too.

In particular:

  1. Use progressive JPEGs in future if possible
  2. Use a CDN (such as CloudFlare, which is free)

Offline

#29 2015-03-13 20:52:00

Bloke
Developer
From: Leeds, UK
Registered: 2006-01-29
Posts: 11,270
Website GitHub

Re: Massive Lag Before Page Load

rossharvey wrote #289032:

Would it be easy to test the sub folder theory by moving only one image?

Not really. I could do with a few images to test at first, then I’d like to let it rip on a few thousand files at once and see how it goes. I need to write that part of the plugin yet though…

Pete and I are setting up an installation with a few thousand files in it to see if we can replicate what you’re experiencing, then I’ll use that to test the plugin.

This might be one of those things whereby it’s not one thing in isolation. We just need to chase down the variables and eliminate them one by one until Bob’s your mother’s parrot or something.


The smd plugin menagerie — for when you need one more gribble of power from Textpattern. Bleeding-edge code available on GitHub.

Txp Builders – finely-crafted code, design and Txp

Offline

#30 2015-03-13 22:04:14

rossharvey
Member
From: Earth. Sometimes.
Registered: 2005-03-16
Posts: 233
Website

Re: Massive Lag Before Page Load

Bloke wrote #289036:

Not really. I could do with a few images to test at first, then I’d like to let it rip on a few thousand files at once and see how it goes. I need to write that part of the plugin yet though…

Pete and I are setting up an installation with a few thousand files in it to see if we can replicate what you’re experiencing, then I’ll use that to test the plugin.

This might be one of those things whereby it’s not one thing in isolation. We just need to chase down the variables and eliminate them one by one until Bob’s your mother’s parrot or something.

You guys are fast! Thank you, lost for words :¬)

Offline

#31 2015-03-13 22:42:49

Bloke
Developer
From: Leeds, UK
Registered: 2006-01-29
Posts: 11,270
Website GitHub

Re: Massive Lag Before Page Load

rossharvey wrote #289037:

You guys are fast! Thank you, lost for words :¬)

No probs. Have you sent the login details to Pete yet?


The smd plugin menagerie — for when you need one more gribble of power from Textpattern. Bleeding-edge code available on GitHub.

Txp Builders – finely-crafted code, design and Txp

Offline

#32 2015-03-13 22:50:16

rossharvey
Member
From: Earth. Sometimes.
Registered: 2005-03-16
Posts: 233
Website

Re: Massive Lag Before Page Load

Bloke wrote #289038:

No probs. Have you sent the login details to Pete yet?

Just sent!

Offline

#33 2015-03-13 23:43:12

ruud
Developer Emeritus
From: a galaxy far far away
Registered: 2006-06-04
Posts: 5,068
Website

Re: Massive Lag Before Page Load

If this is a filesystem issue due to the amount of files and assuming it’s EXT3 or higher, make sure you have dir_tree enabled:

tune2fs -O dir_index /dev/sdx1

Where sdx1 is the partition involved.

Offline

#34 2015-03-13 23:54:30

rossharvey
Member
From: Earth. Sometimes.
Registered: 2005-03-16
Posts: 233
Website

Re: Massive Lag Before Page Load

ruud wrote #289040:

If this is a filesystem issue due to the amount of files and assuming it’s EXT3 or higher, make sure you have dir_tree enabled:

tune2fs -O dir_index /dev/sdx1...

Where sdx1 is the partition involved.

Thanks! Not sure if I can do that on cloud hosting (Vidahost) though!

Offline

#35 2015-03-14 17:04:51

gaekwad
Server grease monkey
From: People's Republic of Cornwall
Registered: 2005-11-19
Posts: 4,137
GitHub

Re: Massive Lag Before Page Load

Sorted (pending final confirmation from Ross). Spam blocklist checking was snagging somewhere; site back to normal.

Last edited by gaekwad (2015-03-14 17:05:07)

Offline

#36 2015-03-14 17:22:49

rossharvey
Member
From: Earth. Sometimes.
Registered: 2005-03-16
Posts: 233
Website

Re: Massive Lag Before Page Load

gaekwad wrote #289061:

Sorted (pending final confirmation from Ross). Spam blocklist checking was snagging somewhere; site back to normal.

Thanks Pete!

(And everyone else who offered ideas! Really appreciate it.)

Last edited by rossharvey (2015-03-14 17:23:14)

Offline

Board footer

Powered by FluxBB