The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Inconsistent speed for query results

Discussion in 'Database Discussions' started by NestMan, Jun 27, 2016.

Tags:
  1. NestMan

    NestMan Active Member

    Joined:
    May 10, 2016
    Messages:
    25
    Likes Received:
    0
    Trophy Points:
    1
    Location:
    Utah
    cPanel Access Level:
    Root Administrator
    What is the best way to troubleshoot why sometimes a query will return results in one second, while sometimes it will take over ten seconds? In fact, sometimes the webpage that makes use of the query will time out. I can understand if my query was poorly written and, if so, then it should consistently run slow. Right? I tail the Apache error log, looking for clues when this sporadic event happens, and it doesn't ever record anything when it does.

    Thank you!
     
  2. twhiting9275

    twhiting9275 Well-Known Member

    Joined:
    Sep 26, 2002
    Messages:
    538
    Likes Received:
    15
    Trophy Points:
    18
    cPanel Access Level:
    Root Administrator
    Twitter:
    There are a number of factors that could contribute to this. Server load, connections to the server, queries running, etc... So many variables.

    Keep mytop running when you're seeing slower queries. I bet you'll see quite a few queries there.

    Also, you may want to consider MariaDB over MySQL, and cache as much as you can, to ram, not disk
     
  3. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    30,667
    Likes Received:
    646
    Trophy Points:
    113
    cPanel Access Level:
    Root Administrator

Share This Page