Please whitelist cPanel in your adblocker so that you’re able to see our version release promotions, thanks!

The Community Forums

Interact with an entire community of cPanel & WHM users!

SQL Queries Stuck in "Statistics"

Discussion in 'Database Discussion' started by KWH, Oct 23, 2017.

  1. KWH

    KWH Member

    Joined:
    Jul 18, 2017
    Messages:
    9
    Likes Received:
    0
    Trophy Points:
    1
    Location:
    UK
    cPanel Access Level:
    Root Administrator
    Hi,

    I have a WordPress website on a cPanel server with:
    • 8 cores
    • 8GB RAM
    • 4GB Swap
    • PHP-FPM enabled (default settings)
    • MySQL 5.6.37-log (MyIsam default storage)
    • PHP7.0
    • wp-posts is a MyIsam table
    The website offers users multiple search options for filtering custom posts. 99% of the time it all works fine, but occasionally we are experiencing the following problem:
    • User selects search options (website delivers live search results, with an optional "search" button).
    • Website hangs indefinitely (hours, if unattended).
    • No one else can use the site until the server is rebooted (restarting MySQL doesn't resolve it).
    I've checked the server status and the System Information is never more than this:
    • Server load: roughly 1 out of 8 cores
    • Memory used: 25%
    • Swap used: 23%
    My SQL Processes show:

    49 root localhost [Database Name] Query 321 Waiting for table level lock UPDATE wp_posts SET post_password = '10af72916b219c715494', post_modified_gmt = '[Date and Time]

    Statistics SELECT SQL_CALC_FOUND_ROWS wp_posts.ID FROM wp_posts INNER JOIN wp_postmeta ON ( wp_posts.ID = wp_

    I've attached a screenshot of the complete process screen the last time this happened.

    My developers are looking into improving the SQL query, but I thought I'd through it out there to see if anyone has any other comment or advice regarding the server set up and SQL query etc.

    Many thanks in advance!
     

    Attached Files:

  2. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    43,889
    Likes Received:
    1,814
    Trophy Points:
    363
    cPanel Access Level:
    Root Administrator
    Hello,

    Do you notice any output to the MySQL error log (/var/lib/mysql/$hostname.err) when this happens?

    Thank you.
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  3. KWH

    KWH Member

    Joined:
    Jul 18, 2017
    Messages:
    9
    Likes Received:
    0
    Trophy Points:
    1
    Location:
    UK
    cPanel Access Level:
    Root Administrator
    Hi,

    No, nothing is being recorded there when it happens.

    Thanks.
     
Loading...

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice