Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#13 2015-03-13 13:01:33

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

Re: Massive Lag Before Page Load

etc wrote #289016:

www.rossharvey.com/portraits/holly – one image, still slow.

Yowzers.The network graph shows no subsequent async requests even get fired off before the HTML has loaded. It’s just doing something that takes too much time, eventually giving up and then serving the remaining content.

And isn’t image info stored in db?

Yes, as long as there aren’t any plugins directly accessing it by looking at file mode time, file or image size, r some other facet of the files like EXIF data.


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

#14 2015-03-13 13:03:37

etc
Developer
Registered: 2010-11-11
Posts: 5,057
Website GitHub

Re: Massive Lag Before Page Load

Bloke wrote #289017:

eventually giving up and then serving the remaining content.

would be my bet.

Offline

#15 2015-03-13 13:08:38

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

Re: Massive Lag Before Page Load

I’ve seen this phenomenon before. If you look at the Holly page, do a full [CTRL-R] refresh it takes 25 seconds to resolve. But a subsequent (soft) refresh is immediate.

Then wait a minute or two and soft refresh again. You get the full 25-second experience again. It’s like the site is cached or proxied (or something) for a short while and then the ‘forgets’ that it has the stuff cached, or the cache expires and it’s forced to do the round-trip, at which point it encounters whatever is causing this issue.

It seems to happen sporadically on some sites and I’ve never go the bottom of this, but would love to do so.


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

#16 2015-03-13 13:22:07

etc
Developer
Registered: 2010-11-11
Posts: 5,057
Website GitHub

Re: Massive Lag Before Page Load

Bloke wrote #289019:

It seems to happen sporadically on some sites and I’ve never go the bottom of this, but would love to do so.

Here it seems to happen on every individual page, so I would start by checking the corresponding forms. And I get 25s lag even on a soft refresh (browser-dependent?)

Offline

#17 2015-03-13 13:23:23

maniqui
Member
From: Buenos Aires, Argentina
Registered: 2004-10-10
Posts: 3,070
Website

Re: Massive Lag Before Page Load

Bloke wrote #289015:

And how many images do you have in the images folder? When the number of files starts to exceed a certain amount (usually over about 700 – 1000 is the sweet spot) things start to slow down when listing directories or performing file operations.

Well, being that this image exists: http://www.rossharvey.com/images/13848.jpg, which such a high ID, I bet the image folder has lots and lots of images…

@Ross, do you have a local copy of your website? does it shows the same symptoms when loading a page? If not, then the issue may be somewhere on your hosting/server (related or not with the image folder having lots of images)…

Re: lots of images in the image folder. Other CMSs and frameworks solve this by creating subfolders (sometimes, using a hashed value for the image file, and grouping the images in subfolders —and even subsubfolders— that start with the same two digits of a hash.
If the problem is indeed related to the amount of images on your image folder, you may want to try grouping them in folders starting with the same digits (ie. images/12/, /images/13/, etc) and then apply some rewrite rule (via .htaccess) to let the server find & serve the correct image. Yes, this may sound like a PITA, and you may have to do it manually to begin with and check if that improves your situation. Then, if it does improve (ie. lag disappears), then you could think on some automation..


La música ideas portará y siempre continuará

TXP Builders – finely-crafted code, design and txp

Offline

#18 2015-03-13 13:36:03

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

Re: Massive Lag Before Page Load

maniqui wrote #289021:

Other CMSs and frameworks solve this by creating subfolders (sometimes, using a hashed value for the image file, and grouping the images in subfolders that start with the same two digits of a hash.

I’ve been mulling this over as a potential (future) approach to smd_thumbnail’s image handling actually. Or even a separate plugin that can be run with a higher priority to ensure it can intercept any further plugin requests for images and direct them to the right folder.

It may be overkill to put in core since it only affects a small percentage of people with tonnes of images, so a plugin isn’t an unreasonable expectation. But I’ll take discussion on this in another thread if anyone wants to chip in.


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

#19 2015-03-13 13:57:31

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

Re: Massive Lag Before Page Load

Thanks so much for looking guys. Amazed at the fast help and ideas you’ve all put forward. Your skills are way beyond mine – with this single Holly image, does that rule out the need for me to try removing the async stuff?

Bloke – you’re more than welcome to an admin login if you’d like a snoot around :¬)

Offline

#20 2015-03-13 13:58:53

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

Re: Massive Lag Before Page Load

I don’t have a local copy, and yes, there are thousands of images in the image folder. Can’t really avoid that with a photography blog :¬)

Mani – I don’t have the time to go through and manually set rewrites for certain image ranges and folders unfortunately.

Last edited by rossharvey (2015-03-13 14:03:39)

Offline

#21 2015-03-13 14:37:46

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

Re: Massive Lag Before Page Load

maniqui wrote #289021:

Well, being that this image exists: http://www.rossharvey.com/images/13848.jpg, which such a high ID, I bet the image folder has lots and lots of images…

I totally missed that. Good spot, Julián.

Edit: I have a vague memory that ext2 file systems under Linux have notable performance problems when you hit about 10,000 files in a directory, or something like that. It’s a possibility.

Another edit: Ignore that part I just added. I loaded 200 images in plain HTML and there’s issue with load time at all.

Last edited by gaekwad (2015-03-13 14:56:34)

Offline

#22 2015-03-13 15:18:04

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

Re: Massive Lag Before Page Load

I don’t use the <images> tag, the images are added as lines of HTML code (using smd_image_selector).

If anyone can help me fix it, I’ll either donate £150 to TXP or to the person directly. Not as an incentive to get help, but as a thank you for doing so. I’m out of my depth here and I very much appreciate the minds that have popped in to try and pinpoint it.

Offline

#23 2015-03-13 16:01:52

kuopassa
Plugin Author
From: Porvoo, Finland
Registered: 2008-12-03
Posts: 229
Website

Re: Massive Lag Before Page Load

rossharvey, have you asked from the website’s hosting provider if they happened to make recently some changes to server settings?

I would ask them about that. Also could be worth testing what effect comes from creating a new Page template, saving it something like default2, then putting inside it something simple, like:

<txp:output_form form="struct_header" />
<txp:output_form form="struct_footer" />

After that from the Sections some sections could be assigned to use default2. For example section called contact could be set to use default2. And then finally you could load http://www.rossharvey.com/contact and see if it’s still lagging. By changing code inside default2 you can sort of detect what parts of the code are causing problems.

Last edited by kuopassa (2015-03-13 16:03:05)

Offline

#24 2015-03-13 16:11:44

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

Re: Massive Lag Before Page Load

kuopassa wrote #289028:

rossharvey, have you asked from the website’s hosting provider if they happened to make recently some changes to server settings?

I would ask them about that. Also could be worth testing what effect comes from creating a new Page template, saving it something like default2, then putting inside it something simple, like:

<txp:output_form form="struct_header" />...

After that from the Sections some sections could be assigned to use default2. For example section called contact could be set to use default2. And then finally you could load http://www.rossharvey.com/contact and see if it’s still lagging. By changing code inside default2 you can sort of detect what parts of the code are causing problems.

The contact page is working fine, I will however try creating a duplicate form for a blog item (the pages that have issues) and add bit by bit. Will take time, but hopefully it will help.

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

Offline

Board footer

Powered by FluxBB