• Resolved PaulieP

    (@pauliep)


    Hi, I have had issues with insane spikes in resource utilization taking down my site several times a day due to Apache HTTP going down as a result.

    After probably 4-5 months of trying to figure this out, my host has finally narrowed it down to spikes in Mysql utilization caused by only one plugin, NextGen Gallery.

    The data is below. Any insight on what this might be and any cure? When I turn off NGG the issue goes away. I have already tried deleting the plugin completely and reinstalling and it does not solve the problem. Running on WP 3.1.2 with the latest NGG, but the issue has preceded the current version.

    Any suggestions? Thanks.

    Pasted from webhost’s support below:
    “Hi,

    Its the wp plugins causing the problem. While checking the status of sql service, I noticed the following queries.


    [root@host ~]# mysqladmin proc stat

    | Id | User | Host | db | Command | Time | State | Info |

    | 802 | txmma2 | localhost | test | Query | 123 | removing tmp table | SELECT t.*, tt.* FROM wp_ngg_gallery AS t INNER JOIN wp_ngg_pictures AS tt ON t.gid = tt.galleryid W |
    | 829 | txmma2 | localhost | test | Query | 112 | removing tmp table | SELECT t.*, tt.* FROM wp_ngg_gallery AS t INNER JOIN wp_ngg_pictures AS tt ON t.gid = tt.galleryid W |
    | 830 | txmma2 | localhost | test | Query | 109 | removing tmp table | SELECT t.*, tt.* FROM wp_ngg_gallery AS t INNER JOIN wp_ngg_pictures AS tt ON t.gid = tt.galleryid W |
    | 831 | txmma2 | localhost | test | Query | 100 | removing tmp table | SELECT t.*, tt.* FROM wp_ngg_gallery AS t INNER JOIN wp_ngg_pictures AS tt ON t.gid = tt.galleryid W |

    These queries are generated from plugin nextgen-gallery. Please see the details below.


    [root@host plugins]# grep -rli ngg_pictures .
    ./nextgen-gallery/admin/upgrade.php
    ./nextgen-gallery/admin/install.php
    ./nextgen-gallery/nggallery.php
    [root@host plugins]#

    Can you please disable this plugin and see if that helps?

    Thanks,
    Pete,

Viewing 7 replies - 1 through 7 (of 7 total)
  • Yes that’s an query from NGG… But I don’t see this as unusual. How many images / galleries do you have in your side ?

    Thread Starter PaulieP

    (@pauliep)

    19023 Images
    124 Galleries
    12 Albums

    I have seen insane CPU and Memory usage spikes at random, for example when I log into my hosting control panel, sometimes the site is super slow and it shows average CPU load of over 50 and sometimes over 100 (not percentage mind you) then drops back down (or Apache goes down and http has to be restarted)

    I dont know if this is an exploit or let’s say bots/spiders trying to index the galleries or what. Very stumped.

    Thread Starter PaulieP

    (@pauliep)

    Also would exploits trying to use the upgrade and install php files also be a potential issue? Should I remove them?

    I think it’s a scaling issue inside my plugin… as the query maybe fetch 5000+ images when you click on a gallery. Need to look into this more in detail, but I could imagine that it can cause an issue.

    The upgrade/install routine itself, should be only performed just one time , but should not causes an issue.

    I recommend as quick solution (I only it’s a “bad” solution), to reduce the number of images inside a gallery

    Thread Starter PaulieP

    (@pauliep)

    Hmm. No gallery exceeds 350 images and some are 100-200 images. would the query fetch more than the number of images inside a single gallery?

    I did my best to reduces the queries… so it’s strange. I’m not sure what more I can optimize on my side. But 100+ Images should not causes a database problem ( unless the db is not setup correcty )

    Thread Starter PaulieP

    (@pauliep)

    As an update, in /admin I renamed two files:
    install.php
    upgrade.php

    to .bak extensions.

    My high utilization issues from mysql stopped. Instead of spikes up to 40-110 on CPU utilization, average load is now under 1 and my site is now noticeably faster on average.

    I suspect bots and search engines?

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘NGG Causing Abnormally High mysql utilization, crashing site’ is closed to new replies.