Take the 2-minute tour ×
Database Administrators Stack Exchange is a question and answer site for database professionals who wish to improve their database skills and learn from others in the community. It's 100% free, no registration required.

The RAM of a server where I have installed mysql is always 100% and looking at the processes that are running, MySQL is the most consumer on CPU and memory and I can see the cause of great use RAM.   Watching the performance on queries, inserts, updates, etc just got to see some queries that ran every hour and it took more than a minute to finish but I fixed that issue. Even so the problem persists and I can not find out why.   I show you how I have configured the my.cnf and qualities of the server to see if anyone can help me improving performance and thus get reduced RAM consumption, and if you need more information, I will be happy to provide it:

my.cnf:

federated

user                            = ()

port                            = 3306

datadir                                              = /var/lib/mysql

tmpdir                                               = /tmp

socket                                              = /var/lib/mysql/mysql.sock

skip-external-locking                          = 1

log_error                                           = /var/log/mysqld.log

event_scheduler                                = on

open-files-limit                                   = 20000


thread-cache-size                              = 16

table-open-cache                               = 2048

table-definition-cache                         = 512


query-cache-size                               = 32M

query-cache-limit                               = 1M

sort-buffer-size                                 = 1M

read-buffer-size                                = 1M

read-rnd-buffer-size                          = 8M

join-buffer-size                                 = 1M

tmp-table-size                                = 64M 

max-heap-table-size                       = 64M

back-log                                        = 100

max-connections                            = 500

max-connect-errors                        = 10000

max-allowed-packet                        = 16M

interactive-timeout                          = 600

wait-timeout                                   = 180

net_read_timeout                     = 30

net_write_timeout                    = 30

back_log                          = 128

default-storage-engine              = InnoDB

innodb                                          = FORCE

key-buffer-size                              = 64M

myisam-sort-buffer-size                  = 128M

innodb-buffer-pool-size                   = 2G

innodb-log-buffer-size                     = 4M

innodb-log-file-size                        = 256M

innodb-log-files-in-group           = 2

server-id                                       = 1

log-bin                     = /var/lib/mysqllogs/db1-binary-log

expire_logs_days                = 14

server-id=21009674

binlog-format                       = mixed

slow-query-log                             = 1

slow-query-log-file                        = /var/lib/mysqllogs/slow-log

[mysqld-safe]

log-error                                       = /var/log/mysqld.log

[mysqldump]

max-allowed-packet             = 16M





Server:

System:             CentOS 6 - MGC LAMP
CPU:                4vCPUs
RAM:            8BG
System Disk:        320GB
Network:            600 Mb / s

Saludos

Mario

share|improve this question

migrated from stackoverflow.com Jun 30 at 13:24

This question came from our site for professional and enthusiast programmers.

    
How much memory is MySQL using, and how much does the server have? –  Michael - sqlbot Jun 30 at 17:08

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.