We are getting more frequent reports of performance issues with our production web site. I believe I know where the problem lies, but don’t know how to resolve or at least reduce the impact of the issue.
First, the required background information:
The site is hosted at EngineHosting on dedicated servers:
* Web servers are two single processor/quad core Intel Xeon X3210 (2.13GHz), 4G ram, 160gig 7200rpm SATA.
* MySQL server is a single processor/quad core 2GHz Xeon E5405, 4G ram, 2x10,000 RPM SAS drives in RAID 1 with 256Mb hardware RAID controller.
Software Information:
* ExpressionEngine 1.6.7 build 20090211
* Multiple Site Manager installed with 10 sites
* MySQL DB version 5.0.45-log (I assume that means EngineHosting turned off SQL logging for us in an attempt to give more speed)
* DB Size: 1.1Gb
http://www.pbinsight.com
The site gets about 250,000 visits every 30 days.
Most pages normally load (the time taken for EE to render the templates) in under a second. More complicated pages load in under 2 seconds.
The problem:
Sometimes, almost randomly, pages can take anywhere from 10 to 80 seconds to load. When this occurs, the site seems to just stall. Through regression testing and weeks of investigation, we see that the issue seems to revolve around relationships. Our product and solutions content includes quite a few bits of related content added via Playa 2.
I believe these pauses are due to the on-demand rebuilding of EE’s relationship caches. Our exp_relationships table has 11,815 records and is a whopping 1.1Gb. exp_weblog_data, by comparison is only 6.5Mb. exp_weblog_titles is only 750Kb.
Across this entire site, there are only 1836 entries.
We also notice the speed issues sometimes in the EE console, when committing changes to records that have these related fields. This tells me that the cache refresh and rebuilding process is occurring when we really want it to, at the time of data entry. It’s when the cache is rebuilt while the site visitors are requesting pages that’s the problem.
Does anyone have any ideas how to resolve this issue? I believe it’s only going to get worse as we add more and more content and related content to the site. I don’t believe this issue is related to Playa as Playa is using the built in relationship features of EE. The culprit, in my mind, is the on-demand rebuilding of relationship caches. There has got to be a way to make the building of the cache records more efficient and faster.