Skip to main content

MySQL Optimization

Comments

8 comments

  • cPanelMichael
    [quote="david.cocos, post: 1647412">The server has a single domain hosted on it with aprox 500 real time users on it. The website freezes for 3-5 minutes, and this happens 5-10 times per day.
    To clarify, does the entire website fail to load, or is it only pages that utilize MySQL? Do you notice any error messages in the MySQL error log when this happens? Thank you.
    0
  • david.cocos
    [quote="cPanelMichael, post: 1647492">To clarify, does the entire website fail to load, or is it only pages that utilize MySQL? Do you notice any error messages in the MySQL error log when this happens? Thank you.
    The entire VPS freezes. I didn't find anything specific in the error log. Which error log would be most useful?
    0
  • cPanelMichael
    If it's an OpenVZ/Virtuozzo VPS, check the /proc/user_beancounters file to see if the VPS is reaching any resource limits imposed from the node. Thank you.
    0
  • david.cocos
    It is a Virtuozzo VPS. This is what the /proc/user_beancounters file is showing: Version: 2.5 uid resource held maxheld barrier limit failcnt 99837: kmemsize 237096228 244813824 773094113 858993459 0 lockedpages 0 0 2059 2059 0 privvmpages 3134756 3193840 7549747 8388608 0 shmpages 1950 1950 524288 524288 0 dummy 0 0 9223372036854775807 9223372036854775807 0 numproc 526 597 1600 1600 0 physpages 7416304 7469372 7549747 8388608 0 vmguarpages 0 0 4194304 9223372036854775807 0 oomguarpages 1525539 1527215 4194304 9223372036854775807 0 numtcpsock 329 370 1550 1550 0 numflock 288 301 1000 1100 0 numpty 0 0 102 102 0 numsiginfo 0 48 1024 1024 0 tcpsndbuf 3412184 7202544 14880000 22320000 677 tcprcvbuf 1857760 2025976 14880000 22320000 0 othersockbuf 339752 650432 14400000 21600000 0 dgramrcvbuf 0 13872 13440000 13440000 0 numothersock 351 404 1700 1700 0 dcachesize 128847168 128849018 115964116 128849018 0 numfile 5745 6825 38496 38496 0 dummy 0 0 9223372036854775807 9223372036854775807 0 dummy 0 0 9223372036854775807 9223372036854775807 0 dummy 0 0 9223372036854775807 9223372036854775807 0 numiptent 70 70 9223372036854775807 9223372036854775807 0
    Thank you [COLOR="silver">- - - Updated - - - This is the original file.
    0
  • cPanelMichael
    Notice the fail count for the "tcpsndbuf" value. Please report this to your VPS hosting provider and have them check to see if they can increase that limit from the VPS hardware node. Thank you.
    0
  • david.cocos
    My VPS Hosting Provider said: "the "tcpsndbuf" value is already the highest value we can offer". So it wasn't very helpful. The specs of the server are: Intel(R) Xeon(R) CPU E5-2620 v2 8 cores, 2,1 GHz, 32 GB RAM, 500 GB SSD. I want to specify that the server uses very few memory. Also max_connections is set to 151. Could this also be a problem? Thank you for your help
    0
  • cPanelMichael
    You are welcome to gather user-feedback for MySQL optimization on this thread. I'm not sure what else would cause your VPS to stop responding. You may want to have you provider address the issue with the VPS failing to respond if it continues to be an issue, or try reviewing the output of additional logs if it happens again (/var/log/messages or /var/log/dmesg). Thank you.
    0
  • david.cocos
    I have also found this with the "sar -P ALL" command: Average: CPU %user %nice %system %iowait %steal %idle Average: all 66.34 0.22 14.09 0.01 0.42 18.92 Average: 0 0.00 0.00 0.00 0.00 0.00 100.00 Average: 1 74.88 0.26 16.07 0.02 0.52 8.25 Average: 2 0.00 0.00 0.00 0.00 0.00 100.00 Average: 3 74.89 0.24 15.98 0.01 0.46 8.42 Average: 4 0.00 0.00 0.00 0.00 0.00 100.00 Average: 5 74.90 0.23 15.82 0.02 0.47 8.56 Average: 6 0.00 0.00 0.00 0.00 0.00 100.00 Average: 7 75.04 0.25 15.78 0.01 0.46 8.47 Average: 8 0.00 0.00 0.00 0.00 0.00 0.00
    I notice that for 4 of my cores %idle is 100%. Is this ok and if not how can I solve this?
    0

Please sign in to leave a comment.