| > It appears that the author has some customizations (plugins..) that are really slow. The slowest piece of code on the network today is the Recent Comments Widget. That's not a plugin, that's right there in the base install. I worked this out myself, based on preliminary detective work by Page.ly. And then Page.ly went the rest of the way to ask a Wordpress core contributor for their opinion. The key issue is that this widget performs a query on the wp_comments table which becomes slower and slower as the number of comments rises. The only real fixes are either to move to Disqus (my bloggers said "no") or partition the table (Page.ly politely said that this was outside the scope of anything under their enterprise plans). > Why not route your traffic through cloudfront ? I do. > Why not leverage full page caching for anonymous users ? That too. I also have memcached for the object cache, I use a tuned copy of PerconaDB and nginx is configured to serve static files and supercache-generated whole pages without ever touching PHP. The blog post you read was served from a blog on that very blog network, on Linode servers in Tokyo that I once again personally managing. |
I dont' see why a selective read based on primary key indexes is taking so long. How many rows are we talking about here ? I'm sure it's under a billion rows - right ? Partitioning it may help but I think there's something significantly wrong with the way the lookup is going through.
The recent comments widget is probably doing things the wrong way around. Is it caching the returned values ? Does it matter if the recent comments widget is based on data that is.. say 2 minutes old ?
I really don't agree with your performance bottlenecks. I run several sites much larger (at-least 20x traffic per day) and granted that they do not all run Wordpress, I know from experience that your system should not be grinding to a halt with just 50k daily uniques.
Even imagining that the comments lookup is like "get all comments for post ID, 2966 --" - that can't possibly be slow enough to destroy your entire server setup. Maybe you just need more RAM ?
Get a dedicated box and get someone to optimize it. If your entire database can be in RAM (Get a box with 16GB of RAM ?), that should work well. That won't cost you $250/month even.
EDIT: I see from another post: As Sean, my head SysAdmin wrote on a ticket to you, some of your pages were performing a sort on 188590 rows in memory each time.
Was that the recent comments widget doing that ? Well, that can be fixed with some clever caching or even a clever fetch technique!
Is that necessary for every load ? Do you have a particular blog post with that many comments ? The right way to go about that would be to pick out comments for a particular post and then sort them - query-wise. Again, your WP install probably needs some (much needed) tuning.
I understand your desire to have someone else worry about your servers, but someone also (apparently) has to worry about your code, and as I understand right now - that person is you. Well, you could definitely make some code level improvements and save on the 'server management' department.