Vesta Control Panel - Forum

Community Forum

Skip to content

Advanced search
  • Quick links
    • Main site
    • Github repo
    • Google Search
  • FAQ
  • Login
  • Register
  • Board index Main Section General Discussion
  • Search

mysql sometimes high cpu.

General questions about VestaCP
Post Reply
  • Print view
Advanced search
4 posts • Page 1 of 1
turquaze
Posts: 7
Joined: Tue Jun 07, 2016 10:39 am

mysql sometimes high cpu.
  • Quote

Post by turquaze » Mon Jun 13, 2016 11:48 am

Hello,

my server 4 thread 8 core.
64gb.
user increases, mysql sometimes %99.
few user, no problem.

my.cnf

Code: Select all

[client]
port=3306
socket=/var/run/mysqld/mysqld.sock

[mysqld_safe]
socket=/var/run/mysqld/mysqld.sock

[mysqld]
user=mysql
pid-file=/var/run/mysqld/mysqld.pid
socket=/var/run/mysqld/mysqld.sock
port=3306
basedir=/usr
datadir=/var/lib/mysql
tmpdir=/tmp
lc-messages-dir=/usr/share/mysql
log_error=/var/log/mysql/error.log
max_connections=110
max_user_connections=30
wait_timeout=30
interactive_timeout=50
long_query_time=5
query_cache_size = 1024M
tmp_table_size = 8G
max_heap_table_size = 512M
innodb_buffer_pool_size = 512M
thread_cache_size = 32
log=/tmp/mysql.log
!includedir /etc/mysql/conf.d/
help me.
Top

turquaze
Posts: 7
Joined: Tue Jun 07, 2016 10:39 am

Re: mysql sometimes high cpu.
  • Quote

Post by turquaze » Tue Jun 14, 2016 7:35 am

Hello, thank you.

I am sure that mysql problem.

what should I do?
Top

skurudo
VestaCP Team
Posts: 8099
Joined: Fri Dec 26, 2014 2:23 pm
Contact:
Contact skurudo
Website Facebook Google+ Skype
Twitter

Re: mysql sometimes high cpu.
  • Quote

Post by skurudo » Tue Jun 14, 2016 8:13 am

XoXiLhJ0mn wrote:In Webmin, you could see from the webinterface many details of each connection. From this, you need to trace which SQL queries are being executed.
Well, here you can see mysql status too:
https://ip:8083/list/server/?db
ExampleShow

Code: Select all

MySQL localhost status
Uptime: 1565989
Threads: 2
Questions: 464457847
Slow queries: 230
Opens: 1619607
Flush tables: 1
Open tables: 4096
Queries per second avg: 296.590

+---------+-------------+-----------+-------------+---------+------+--------------+------------------------------------------------------------------------------------------------------+
| Id      | User        | Host      | db          | Command | Time | State        | Info                                                                                                 |
+---------+-------------+-----------+-------------+---------+------+--------------+------------------------------------------------------------------------------------------------------+
| 3105102 | rnt_shp | localhost | rnt_shp | Sleep   | 0    |              |                                                                                                      |
| 3105103 | gld_ru    | localhost | gld_ru    | Query   | 0    | Sending data | SELECT COUNT(DISTINCT p.product_id) AS total FROM product p LEFT JOIN product_description pd ON (p.p |
| 3105105 | root        | localhost |             | Query   | 0    |              | show processlist                                                                                     |
+---------+-------------+-----------+-------------+---------+------+--------------+-----------------------------------------------
Top

Elizine
Posts: 50
Joined: Wed Aug 12, 2015 12:11 pm
Contact:
Contact Elizine
Website

Re: mysql sometimes high cpu.
  • Quote

Post by Elizine » Tue Jun 14, 2016 10:36 am

Enabling the query cache can possibly help, like switching query_cache_type to ON and setting the query_cache_size to 1G.

If that helps, you could also try to play with it's amount, because different values can give different result, even "more is better" rule sometimes doesn't apply.
Top


Post Reply
  • Print view

4 posts • Page 1 of 1

Return to “General Discussion”



  • Board index
  • All times are UTC
  • Delete all board cookies
  • The team
Powered by phpBB® Forum Software © phpBB Limited
*Original Author: Brad Veryard
*Updated to 3.2 by MannixMD
 

 

Login  •  Register

I forgot my password