Running a 2GB host @rackspace cloud --
Apache 2.2.x
Mysql 5.1.x ( ~82% hit ratio on query cache)
PHP 5.1.x
APC opcode caching (~100% hit ratio)
Memcache for php sessions
S9y v1.6.0
Extended entry properties plugin with caching
mysql> select count(*) from serendipity_entries;
+----------+
| count(*) |
+----------+
| 4310 |
+----------+
1 row in set (0.00 sec)
Monitoring shows an average of ~40 queries/second on the database (~32 of which are from query cache). Apache accesses are in the range of 12 - 20 req/second. I start 30 apache processes with min spare of 5 and max spare of 25. Keepalives are on, but timeout is very low. Avg busy processes is just a few more than req/sec.
Currently all of these things run on the same machine with negligible I/O wait (<0.8%). My load is high-ish >0.85 and mysql consumes a lot of CPU. When tracking this down (via newrelic), the largest consumer by far is SELECT actions on serendipity_entries from index.php. (I can't get more granular than that without a premium account). I assume this is all a result of cached entries being pulled for each page view. Latency has been creeping up and I'm currently operating under the thought that it's CPU contention. Our ad serving plays a part as well, but it's easier to yell at vendors when everything else is fast.
I'm thinking about two potential solutions... using memcache to cache entries from serendipity_entries and (maybe simplier) a varnish cache running in front of serendipity. The one blocker I see to that is the pragma: nocache delivered by index.php. It's a possibility to split mysql off to it's own server (I've run this way in the past actually), but I'm trying to avoid the cost of a second machine.
Thoughts? Other ideas?
As an aside:
A while back I started writing a plugin for AWS (s3 in particular), but that won't fix this particular issue. I was doing that with the idea that separating media from the install tree might allow me to run many load balanced instances of s9y without shared storage. It would also let me spin up and spin down instances at will.
https://github.com/fishnix/serendipity_event_aws