Mysql กิน cpu ไป 80% ทำไงดีครับช่วยดูให้หน่อยครับ

The MySQL database server configuration file.

You can copy this to one of:

- “/etc/mysql/my.cnf” to set global options,

- “~/.my.cnf” to set user-specific options.

One can use all long options that the program supports.

Run program with --help to get a list of available options and with

–print-defaults to see which it would actually understand and use.

For explanations see

http://dev.mysql.com/doc/mysql/en/server-system-variables.html

This will be passed to all mysql clients

It has been reported that passwords should be enclosed with ticks/quotes

escpecially if they contain “#” chars…

Remember to edit /etc/mysql/debian.cnf when changing the socket location.

[client]
port

กินตลอดเลยเวลาหรือ แค่บางช่วงครับ
ลองเอา server status

top

top - 11:13:35 up 18:30,

ลองรัน mysql tuner ดูครับ อาจจะทำให้พอหาสาเหตุได้ http://blog.mysqltuner.com

ลองไปดูเรื่อง table lock กับ table index ก่อนครับ
ถ้า table ไม่ทำ index แก้ my.cnf ให้ตายก็ไม่ช่วยอะไร

ให้เช็คว่ามาจากเว็บไหนก่อนครับ เพราะอาจโดน bot ยิงมา. ถ้าเจอให้ suspend เว็บนั้นไปก่อน แล้วสั่ง kill process mysqld ให้หมด และ restart ดูสัก 5 นาทีว่าหายหรือเปล่า. ถ้าหายต้องคุยกับเจ้าของเว็บที่ถูก suspend ครับ

Tuning+Optimize tables ครับ ทำ index เท่าที่จำเป็น จะช่วยได้มาก