WordPress.org

Ready to get started?Download WordPress

Forums

Massive Amount of PHP/MySQL Queries Causing High Server Load (9 posts)

  1. jschuller
    Member
    Posted 4 years ago #

    I run a site with around 12 WordPress installs and have been having major issues lately with my dedicated server crashing because of a abnormally high load of PHP/MySQL queries. My web host is convinced that WordPress or something in one of my themes is the cause for this issue, but I am running WP Super Cache for every install which is another part of the puzzle. If my host admins are correct, and WordPress is the cause what should I be looking for? Any suggestions at this point would be greatly appreciated. Basically my sys-admins are stating that every user visiting my site is spawning about 200+ PHP/MySQL queries.

    Jason

  2. carlosmendoza
    Member
    Posted 4 years ago #

    Have you tried to verify the number of queries per page request?.
    Add to the footer.php of your theme this: <!-- <?php echo get_num_queries(); ?> queries. <?php timer_stop(1); ?> seconds. --> and visit some pages of your site checking for the result of the code above in the page source (disable the cache first), this will give you an idea of the pages with the highest number of queries.

    With this you can figure if it's caused by a plugin or by multiple loops in the template and work to optimize or reduce the number of queries

    Even with WP Super Cache enabled at some point depending of your sites activity WordPress has to regenerate the page.

  3. xdesi
    Member
    Posted 4 years ago #

    Your one site has 12 WP installs, or you mean you have 12 seperate sites running WP?

    Do as Carlos suggests in checking how many queries are running on each install, then possibly we/you can isolate the problem further until a solution is achieved.

  4. jschuller
    Member
    Posted 4 years ago #

    12 separate WP installs (basically theme demos) and then the 1 primary WP install for the site. I am only showing "19 queries. 6.292 seconds." which should not be a problem and definitely does not reflect what my host is telling me.

  5. carlosmendoza
    Member
    Posted 4 years ago #

    you are right, 19 queries shouldn't be a problem, perhaps another application is causing the load, because 6.2 seconds for 19 queries is high.

  6. xdesi
    Member
    Posted 4 years ago #

    Can you provide a link to the site in action here?

    Agreed it does not reflect the 200 queries as stated by your hosts, however 6 seconds is still very long, it should be doing this in about a second afaik..

    So my instincts without seeing anything would be a plugin or your theme has something going on which is causing a problem.

    Post a link if possible, also check your DB logs to see if they provide further insight.

  7. jschuller
    Member
    Posted 4 years ago #

    Link is:

    http://www.press75.com/

    Wen't though all my site and demo DB logs with nothing suspicious that I could see anyway. Even cleaned up and optimized all the tables for the site and demo DB's as well.

    Jason

  8. David
    Member
    Posted 4 years ago #

    Jason, I recently purchased your theme pack and fyi I had problems loading you press75 pages late last week and the forum was working off and on also. Regardless love the themes! http://www.visitrevelstoke.com

  9. copypress
    Member
    Posted 4 years ago #

    @jschuller

    i wud like to knw what u did to solve this as i am having the same issue.
    thnx

Topic Closed

This topic has been closed to new replies.

About this Topic