Optimizing Site Speed for Large Sites

Permalink
I have a site hosted on a Rackspace Cloud Server (http://knsiradio.com).

The site has been becoming increasingly slower over the months, and I'm not entirely sure why. It's a pretty massive news site - several thousand pages with a dozen or so new ones added each day.

The server it's on serves up the other sites on the server just fine (http://lite999.com for example).

Are there any tips/tricks/tweaks that I can do to make this news site run faster?

When I look at the Net Tab in Firebug, the longest wait time is for the server to respond to the browser with first byte info. 3 - 10 seconds usually. Rackspace tells me this is usually due to the CMS processing data and taking up system resources.

Speaking of which, I've had to (on three occasions now) increase the max memory that a PHP script can use from 32MB to 64MB to now 128MB because scripts on the site were timing out and eating up to much RAM.

I know this website (concrete5.org) is even more massive than mine and the site is lighting quick - so I know it can be done.

I'm just not sure what I should be doing.

Thanks!

leinteractive
 
leinteractive replied on at Permalink Reply
leinteractive
Sorry to bump my own thread...anyone have any thoughts on this?
mhawke replied on at Permalink Reply
mhawke
How often have you run the job to "Remove Old Page Versions"? With that number of pages, you might want to set up a cron job to run that job every day. I found I needed to run that job a bunch of times to clear out all the old pages because I don't think it clears them all in the first pass.

That's what I'd try first.
leinteractive replied on at Permalink Reply
leinteractive
I run that job every night at midnight.
Remo replied on at Permalink Reply
Remo
I think this is because you load a lot of pages objects. It's basically what I wrote here:http://www.concrete5.org/community/forums/installation/time-to-firs...

What does this mean: Loading page objects take a bit of time, especially if there's no cache and if there are a lot of attributes. I do have an idea on how to rewrite this code but I currently don't have any time to work on it. Got a few deadlines ahead of me and community work has to wait till then..

What can you do if you don't want / can't rewrite the code: Use a cache like APC. If you work with APC, page objects (and others) are caching in the memory. This of course makes things faster. I don't have access to this server (concrete5.org) but I assume that this site would be much slower without APC.

If you can enable APC, this should help. But please note: APC on a server where PHP runs in CGI mode, doesn't help at all and even with some FCGI configurations isn't worth the effort. The server guys should know what they are doing..

If you can't enable APC, you only have one option left: Remove autonav blocks. Use a different navigation which uses less pages (no drop down) or something completely different.
leinteractive replied on at Permalink Reply
leinteractive
Thanks, Remo.

I've verified the APC was already enabled on the server.

I'm tempted to hardcode the nav into the page since that never changes - but I'm not sure how much of a different it will make.

I'll keep plugging away at this. If you have time to revisit this thread when your schedule allows, I would be very appreciative.

Thanks!
leinteractive replied on at Permalink Reply
leinteractive
Okay, so I just copied the html output from the autonav and hard coded it into the page.

I was surprised to see the time to first byte is down from 10-12 seconds to 5-6 seconds and total page load time is down from 12-16 seconds to 8-10 seconds.

I didn't expect that at all. The faster loads are still pretty slow all things considered, but it gives me hope that I can further optimize things.
Remo replied on at Permalink Reply
Remo
Loading a page object takes about 20ms on my server if I disable all the caches. This number gets bigger if there are lots of attributes (delete unused attributes!).

However, with APC, the difference shouldn't be that big. Did you specify APC as a cache library (config/site.php):
define('CACHE_LIBRARY', 'apc');
leinteractive replied on at Permalink Reply
leinteractive
I didn't know I had to define the cache in my config file.

I did that, and it did appear to help a little bit. So after defining that, and removing the hard coded auto nave, my page loads appear to have dropped in half (or so)

...from 12-16 seconds down to 5-9 seconds.

Still a little sluggish...but MUCH better than where I was at before!
Remo replied on at Permalink Reply
Remo
Well, you don't have to, APC improves the PHP code execution in general but if you specify it as a library, concrete5 will also put some objects in a APC memory cache to improve things even more.

This is only noticeable if you're using the basic (or full page) cache though. APC and basic cache with 5.6.0.2 should be the best combination.
Cahueya replied on at Permalink Reply
@Remo

The autonav seems to be a big factor for site speed, in another thread, you mentioned that you have coded another nav which is more adequate / better for performance. Is there any hope that this will be available anytime?

Thanks :)
Remo replied on at Permalink Reply
Remo
The autonav we're using on some pages doesn't have a real UI. It just an ugly piece of code.. It's not complete and I'm more than sure it would generate a ton of support requests and I'm not eager to get more messages/mails than I already get.

This ugly piece won't be released..

However, I intend to rewrite the autonav block we currently have and keep it 100% compatible with all the templates we're using. I still believe that I can improve the performance in this block by at least 50% (on servers without APC, see comment above). I definitely plan on releasing this, but it probably won't happen anytime soon. Could even get 2013!