Single page with multiple areas takes too long to load
Permalink
I've been battling with single pages for a while now and I'm curious if anyone here can help.
I've created a single page that is accessed from a link that passes its cID as a simple $_GET variable.
The cID is captured and cached so it can persist into edit mode.
There is only one C5 area on the page and its arHandle is based on said cID value eg. $area = new Area('Content-' . $cID);
This area stores on average 3-5 core image and YouTube blocks and I'd say about ~150 to 200 pages now have "entries" on this page, each with their own image/YT blocks.
At first, the page loaded normally, but lately it's taking up to ~20-30 seconds to load.
I've tried timestamping to see if something in the single page's code is holding things up, but the elapsed time is always negligble. Our servers show that mysqld process is pegged near 100% when just attempting to access the page (before it even renders).
My guess is the sheer amount of different areas on the page, but only one is ever being displayed at a time. There is no way to access the page to show ALL areas' content.
Anyone have any clue how I broke the Internet?
Cheers!
I've created a single page that is accessed from a link that passes its cID as a simple $_GET variable.
The cID is captured and cached so it can persist into edit mode.
There is only one C5 area on the page and its arHandle is based on said cID value eg. $area = new Area('Content-' . $cID);
This area stores on average 3-5 core image and YouTube blocks and I'd say about ~150 to 200 pages now have "entries" on this page, each with their own image/YT blocks.
At first, the page loaded normally, but lately it's taking up to ~20-30 seconds to load.
I've tried timestamping to see if something in the single page's code is holding things up, but the elapsed time is always negligble. Our servers show that mysqld process is pegged near 100% when just attempting to access the page (before it even renders).
My guess is the sheer amount of different areas on the page, but only one is ever being displayed at a time. There is no way to access the page to show ALL areas' content.
Anyone have any clue how I broke the Internet?
Cheers!
I'm guessing since the average page has maybe 2-4 areas that this wouldn't be needed, but in our case when we had ~150-200 areas with 2-8 blocks each this was required given how many queries were looking up the same values over and over.
Thanks to fran and the others in the chat room for their insight as well :)