WordPress.org

Ready to get started?Download WordPress

Forums

WordPress and server load (10 posts)

  1. webwalrus
    Member
    Posted 8 years ago #

    I have a website that I'm admin-ing (http://www.calvinistgadfly.com), and it gets 25,000 to 40,000 visits per month. The hosting provider has informed me that database load from this site is *extremely* high, and I'm wondering what sorts of tips/tricks you guys might have to help reduce the database load.

    I know that reducing the # of queries should reduce load, but what sorts of things initiate database queries? Does having two different blog categories tagged separately mean two queries?

    Any info you guys have on WP optimization in general would be *greatly* appreciated

  2. VaamYob
    Member
    Posted 8 years ago #

    Not sure, but it may help if you didn't have so many posts/articles on one page.

    Break it up into 10 article/post pages.

    Edit: your site is already pretty bare-bones. Maybe it's time to get your own server ?

  3. moshu
    Member
    Posted 8 years ago #

    You can always put this tags in your footer
    <?php echo $wpdb->num_queries; ?> queries. <?php timer_stop(1); ?> seconds.
    to check the number of queries. Also, search for WP Cache and query optimization.

  4. VaamYob
    Member
    Posted 8 years ago #

    You could also look into caching your pages (if you can live with a X minute delay). Check out the wp-cache plugin.

    Edit: moshu beat me to suggesting the wp-cache plugin.

  5. Cypher
    Member
    Posted 8 years ago #

    Always start with the plugins. Which ones do you have loaded? Any statistic plugins? Since you are only dealing with database usage, you can ignore plugins that modify content on the fly, but look at those plugins that store information back into the database.

    Regards

  6. webwalrus
    Member
    Posted 8 years ago #

    Okay....slapped a meter on it....*42* queries. Isn't that the answer to life, the universe, and everything? :) That seems way high, so I'm going to be doing some digging. My other site, by the way, has 14 queries. For reference, is there a number of queries that's "typical", or a "you're not going to get below x queries, so don't try"?

    Just curious....thanks for all the great information guys!

  7. VaamYob
    Member
    Posted 8 years ago #

    I dunno about typical, but my blog config/theme/plugins uses 18 queries.

  8. Cypher
    Member
    Posted 8 years ago #

    Using a plugin like "WP-Cache" will dramatically reduce the load because it will cache the requests. So using this in combination with reducing the queries might get you the best possible gains..

    Regards

  9. VaamYob
    Member
    Posted 8 years ago #

    Agreed.

    My blog's main page:

    * NO cache
    ** 14 requests/second
    ** average 6.8 seconds per request
    ** 100% CPU usage

    * With cache
    ** 23 requests/second
    ** average 3 seconds per request
    ** 5% CPU usage

    this test was performed with ab at concurrency of 100 for 500 requests.

    With wp-cache, you don't see much improvement under normal circumstances, but under load, there's a world of difference (see the CPU usage).

  10. webwalrus
    Member
    Posted 8 years ago #

    Okay...wp-cache is enabled and *crossing fingers* running properly. I've got the cache timeout set to 86400, as this blog doesn't accept comments - it's just once or twice per day posts by the admin, and he can manually toss the cache when he needs it refreshed. Looks like the cache is up and running great! Thanks for all the help!

Topic Closed

This topic has been closed to new replies.

About this Topic