Announcement

Collapse
No announcement yet.

MYSQL is very slow

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • MYSQL is very slow

    Hello, My server is 6 core 16 GB Memory +cpanel+cloudlinux running WordPress sites.
    MYSQL is very slow!
    How to optimize my.cnf file for optimizing better MYSQL experience.
    [root@server1 ~]# cat /etc/my.cnf
    [mysqld]
    performance_schema = ON
    performance_schema_events_waits_history_size = 20
    performance_schema_events_waits_history_long_size = 15000
    datadir = /var/lib/mysql
    socket = /var/lib/mysql/mysql.sock
    symbolic-links = 0
    log-error = /var/log/mysqld.log
    innodb_file_per_table = 1
    max_allowed_packet = 268435456
    key_buffer = 16M
    read_buffer = 60K
    sort_buffer = 1M
    innodb_buffer_pool_size = 64M
    tmp_table = 8M
    max_allowed_packet = 16M
    thread_stack = 192K
    thread_cache_size = 8
    # This replaces the startup script and checks MyISAM tables if needed
    # the first time they are touched
    myisam-recover = BACKUP
    max_connections = 100
    wait_timeout=300

    result are: (I used this script at end of page to check MYSQL... )
    [root@server1 ~]# ./mycheck-mysql.sh
    +------------------------------------------+--------------------+
    | key_buffer_size | 16.000 MB |
    | query_cache_size | 1.000 MB |
    | innodb_buffer_pool_size | 64.000 MB |
    | innodb_additional_mem_pool_size | 0.000 MB |
    | innodb_log_buffer_size | 16.000 MB |
    +------------------------------------------+--------------------+
    | BASE MEMORY | 97.000 MB |
    +------------------------------------------+--------------------+
    | sort_buffer_size | 1.000 MB |
    | read_buffer_size | 0.059 MB |
    | read_rnd_buffer_size | 0.250 MB |
    | join_buffer_size | 0.250 MB |
    | thread_stack | 0.188 MB |
    | binlog_cache_size | 0.031 MB |
    | tmp_table_size | 8.000 MB |
    +------------------------------------------+--------------------+
    | MEMORY PER CONNECTION | 9.777 MB |
    +------------------------------------------+--------------------+
    | Max_used_connections | 3 |
    | max_connections | 100 |
    +------------------------------------------+--------------------+
    | TOTAL (MIN) | 126.332 MB |
    | TOTAL (MAX) | 1074.734 MB |
    +------------------------------------------+--------------------+

  • #2
    Howdy Elearnnow1,

    Looking at your config, I dont see any reason for things to be slow, so lets start troubleshooting. I would deploy PHP X-Ray on this site and start running those tools to discover whats slowing things down. If you cant do that, yum install mytop, re-create the test database in MySQL/MariaDB and turn on the slow query logger and wait for site to bog down again.

    Comment

    Working...
    X