My friend has a blog that has more than 300k posts on it. The performance of the blog has pretty much crippled his server. Is there a know limit to the posts on WP, or are there any performance optimizations that one can perform?
The blog posts are intended for archiving.
You can probably greatly increase the blog speed by deleting all your post/page revisions from the database. I've seen databases with only 500 posts/pages shrink from 35 megs to 5 megs after cleaning, with a resulting huge increase in blog speed and usability. Run this query in phpmyadmin, changing table the prefixes as necessary, and backup the database beforehand.
DELETE a,b,c
FROM wp_posts a
LEFT JOIN wp_term_relationships b ON (a.ID = b.object_id)
LEFT JOIN wp_postmeta c ON (a.ID = c.post_id)
WHERE a.post_type = 'revision'
Or use this plugin: http://wordpress.org/extend/plugins/bulk-delete/
Then add this line to wp-config.php to stop revisions:
`define ('WP_POST_REVISIONS', FALSE);
And then in phpmyadmin, optimize the database by selecting all the tables and then using the dropdown menu. That will delete all the overhead from cleaning the revisions.
These are always the two things about optimization: (1) figure out what's really causing the problem and (2) do less work.
You have to ask: what is it that's actually slowing things down? The easiest thing to check is the database -- you need to look up MySQL's Slow Query Log. It will tell you which queries are taking the most time. Then you can fix them by (a) creating indexes, (b) rewriting your theme not to use them, or (c) caching the results of the query.
If there are no unusually slow queries, then you'll have to look deeper -- profile your PHP. But there will be slow queries. That's the way of Wordpress.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With