Nevin, thank you very much for taking the time to provide such details answers. This has given me a lot to go on, but has also lead me to even more questions.
Have you fully analyzed the logic in your templates? 3rd party add-on impacts to render times?
Yes. Many of the embeds / site template rely heavily on advanced conditionals, multiple embeds, and plugins to render our content. When cached, I can get a page to render in 0.5 seconds. When not cached, it’s typical to see the weblog:entries part take 2 seconds, comments take anywhere between 2-5 seconds depending on the number of comments, header/footer/navbar embeds take another couple of seconds.
I’m not sure where to start in terms of simplifying templates. It’s a complex site, and the impression I’ve always gotten about EE is that it’s a blank slate—it may not do everything out of the box, but it has great addon support to make it what you want. I heavily use imgsizer, primary category, and child categories. I use MD eexcerpt, html stripper, xml encode to generate my meta description and rss. I’ve created my own plugin to force only entries to be displayed in eastern time. I see the log on the template debugging grow and grow, but I’m not sure how to avoid it without sacrificing what I want to display and render.
But again, it’s night and day between when a template is cached or not. If cached, rarely does it take over 1 second. If not, it will take anywhere between 5-20 seconds.
Are you seeing heavy web server resource usage (cpu/ram) per page request?
I see cpu spikes to 15% for threads while they’re processing pages. We have plenty of free ram.
Are you seeing an impact at the db server level?
Yes, MySQL can easily get backed up, sending the apache thread to 100%, and stalling the site. Dave is very knowledgeable out MySQL tuning; I’ve done my own research and used many of the common MySQL analysis tools, and our server admins also have gone through the configuration as well. We’ve eeked about as much performance as we can out of that server (4 2Gz Xeons; 8 GB RAM). It’s still very typical to ee queries in the slow query log or backing up the processlist while they cull through thousands of rows and copy to tmp tables.
I’ve taken a look at what queries are the worst culprits. The worst one was a query to get the next/previous entry in a category. Although we wanted that feature, we had to greatly reduce it’s use since it was too expensive. The queries used to generate our category and monthly archives, and the recent headlines widget also appear to be expensive.
Have you considered pulling in outside consulting to assist in analyzing your bottlenecks? ie: Solspace Performance Analysis?
We have. We thought our questions were better suited for the people who created the product; we wanted the info from the horse’s mouth instead of a 3rd party so to speak.
Further Questions:
It’s very tempting to hack the core files, and bump up that 1000 URI cache limit to something more like 5000 or 10000. It seems like our webserver could easily handle more cached requests. Could you explain why that might not be a good idea? Also, when I look in the cache folder, I see 4 folders:
db_cache: what does this correspond to in the Admin UI… dynamic weblog caching?
page_cache: presumably the template caches
sql_cache: the query caching?
tag_caching: presumably the tag caches
What counts against the 1000 limit? For example, I just did a count on the number of directories in the page_cache directory (ls -1 page_cache/ | wc -l): 29685. That doesn’t make sense to me. Do the files in the sql_cache also count against the 1000? If not, is there a separate limit for the caches that don’t fall into that 1000 limit?
A good extra source of information if you have a high traffic site would be Handling Extreme Traffic, but really those settings and the disk i/o section can impact even moderate traffic sites.
We do have all but single entry hit tracking turned off.
Unless you actually are seeing a specific need, for a specific template, to be cached, I would highly recommend to not cache unless you have to.
In the above example of my sidebar embed… let’s say I find it beneficial to be cached, I also decide my homepage benefits, but my single entry page doesn’t. However, since my sidebar is embeded on my single entry pages, does turning off the cache for my single entry template actually reduce the number of files to cache? If I understand you correctly, that embed has to be cached for every single entry URI whether or not I have that single entry template cached or not. (In a scenario with a site with 100 entries versus 10000, it seems like the site with 100 entries benefits from the template cache while the 10000 entry site does not).
How are you making the global headlines list? Do you need more than just the title and the date?
Weblog Entries Tag, disabling categories, category_fields, custom_fields, member_data, pagination, trackbacks