This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

mysqld Chewing 40%+ CPU and 40%+ RAM

ASG 320 w/ v7.004

Anyone seen this before? Don't know how to debug it ...


This thread was automatically locked due to age.
Parents Reply Children
  • Yes, perhaps PRoxy Content Manager is bashing it...
  • MySQL is using lots of RAM on my box as well.

    I'm not running any of the proxies (except DNS and NTP).

    On my machine running 7.004 with 54 days of uptime, MySQL was using 291M VSZ and 165M RSS!

    This was causing some swapping.

    The strange thing is the /var/storage/mysql/ directory is only 29MB, so I don't see what it could possibly be caching,
    UNLESS lots of temporary tables are being created by Astaro and not being freed.

    I've upgraded to 7.005 and upgraded my RAM to 512MB, and followed William's suggestion of changing the kernel swappiness value, so we'll see how it goes.
    I haven't edited the my.cnf yet.

    Barry
  • could you post your my.cnf?  I bet there's some tuning to be done.
  • Below is /etc/my.cnf from my 7.005 box
    I know how to tune MySQL, but ISTM it shouldn't be necessary... there's only 29MB of data.

    Thanks,
    Barry

    [mysqld]
    port            = 3306
    socket          = /var/chroot-cffd/var/lib/mysql/mysql.sock
    skip-locking
    key_buffer = 16M
    max_allowed_packet = 1M
    table_cache = 64
    sort_buffer_size = 512K
    net_buffer_length = 8K
    read_buffer_size = 256K
    read_rnd_buffer_size = 512K
    myisam_sort_buffer_size = 8M
    #relay-log=ha_relay.nnnnnn
    #relay-log-index=ha_relay.index
    #relay-log-info-file=ha_relay.info
    #log-bin=ha_replication_
    #binlog-do-db=STORAGE
    #server-id=

    # Don't listen on a TCP/IP port at all. This can be a security enhancement,
    # if all processes that need to connect to mysqld run on the same host.
    # All interaction with mysqld must be made via Unix sockets or named pipes.
    # Note that using this option without enabling named pipes on Windows
    # (via the "enable-named-pipe" option) will render mysqld useless!

    #skip-networking

    # Replication Master Server (default)
    # binary logging is required for replication
    # log-bin=mysql-bin

    # required unique id between 1 and 2^32 - 1
    # defaults to 1 if master-host is not set
    # but will not function as a master if omitted
    #server-id      = 1

    # Replication Slave (comment out master section to use this)
    #
    # To configure this host as a replication slave, you can choose between
    # two methods :
    #
    # 1) Use the CHANGE MASTER TO command (fully described in our manual) -
    #    the syntax is:
    #
    #    CHANGE MASTER TO MASTER_HOST=, MASTER_PORT=,
    #    MASTER_USER=, MASTER_PASSWORD= ;
    #
    #    where you replace , ,  by quoted strings and
    #     by the master's port number (3306 by default).
    #
    #    Example:
    #
    #    CHANGE MASTER TO MASTER_HOST='125.564.12.1', MASTER_PORT=3306,
    #    MASTER_USER='joe', MASTER_PASSWORD='secret';
    #
    # OR
    #
    # 2) Set the variables below. However, in case you choose this method, then
    #    start replication for the first time (even unsuccessfully, for example
    #    if you mistyped the password in master-password and the slave fails to
    #    connect), the slave will create a master.info file, and any later
    #    change in this file to the variables' values below will be ignored and
    #    overridden by the content of the master.info file, unless you shutdown
    #    the slave server, delete master.info and restart the slaver server.
    #    For that reason, you may want to leave the lines below untouched
    #    (commented) and instead use CHANGE MASTER TO (see above)
    #
    # required unique id between 2 and 2^32 - 1
    # (and different from the master)
    # defaults to 2 if master-host is set
    # but will not function as a slave if omitted
    #server-id       = 2
    #
    # The replication master for this slave - required
    #master-host     =   
    #
    # The username the slave will use for authentication when connecting
    # to the master - required
    #master-user     =   
    #
    # The password the slave will authenticate with when connecting to
    # the master - required
    #master-password =   
    #
    # The port the master is listening on.
    # optional - defaults to 3306
    #master-port     =  
    #
    # binary logging - not required for slaves, but recommended
    #log-bin=mysql-bin

    # Point the following paths to different dedicated disks
    #tmpdir         = /tmp/
    #log-update     = /path-to-dedicated-directory/hostname

    # Uncomment the following if you are using BDB tables
    #bdb_cache_size = 4M
    #bdb_max_lock = 10000

    # Uncomment the following if you are using InnoDB tables
    #innodb_data_home_dir = /var/lib/mysql/
    #innodb_data_file_path = ibdata1:10M:autoextend
    #innodb_log_group_home_dir = /var/lib/mysql/
    #innodb_log_arch_dir = /var/lib/mysql/
    # You can set .._buffer_pool_size up to 50 - 80 %
    # of RAM but beware of setting memory usage too high
    #innodb_buffer_pool_size = 16M
    #innodb_additional_mem_pool_size = 2M
    # Set .._log_file_size to 25 % of buffer pool size
    #innodb_log_file_size = 5M
    #innodb_log_buffer_size = 8M
    #innodb_flush_log_at_trx_commit = 1
    #innodb_lock_wait_timeout = 50
  • After 11 hours of uptime, MySQL is at 121MB Virtual and 22MB RSS.


    mysql> show processlist;
    +----+------+-----------------+---------+---------+------+-------+------------------+
    | Id | User | Host            | db      | Command | Time | State | Info             |
    +----+------+-----------------+---------+---------+------+-------+------------------+
    |  9 | root | localhost:48238 | STORAGE | Sleep   |    1 |       | NULL             | 
    | 10 | root | localhost       | NULL    | Query   |    0 | NULL  | show processlist | 
    +----+------+-----------------+---------+---------+------+-------+------------------+
    2 rows in set (0.03 sec)
  • mysql> show status;
    
    | Variable_name                     | Value    |
    | Aborted_clients                   | 6        | 
    | Aborted_connects                  | 0        | 
    | Binlog_cache_disk_use             | 0        | 
    | Binlog_cache_use                  | 0        | 
    | Bytes_received                    | 79       | 
    | Bytes_sent                        | 424      | 
    | Com_show_processlist              | 1        | 
    | Com_show_slave_hosts              | 0        | 
    | Com_show_slave_status             | 0        | 
    | Com_show_status                   | 1        | 
    | Compression                       | OFF      | 
    | Connections                       | 11       | 
    | Created_tmp_disk_tables           | 0        | 
    | Created_tmp_files                 | 5        | 
    | Created_tmp_tables                | 1        | 
    | Delayed_errors                    | 0        | 
    | Delayed_insert_threads            | 0        | 
    | Delayed_writes                    | 0        | 
    | Flush_commands                    | 1        | 
    | Handler_commit                    | 0        | 
    | Handler_delete                    | 0        | 
    | Handler_discover                  | 0        | 
    | Handler_prepare                   | 0        | 
    | Handler_read_first                | 0        | 
    | Handler_read_key                  | 0        | 
    | Handler_read_next                 | 0        | 
    | Handler_read_prev                 | 0        | 
    | Handler_read_rnd                  | 0        | 
    | Handler_read_rnd_next             | 0        | 
    | Handler_rollback                  | 0        | 
    | Handler_savepoint                 | 0        | 
    | Handler_savepoint_rollback        | 0        | 
    | Handler_update                    | 0        | 
    | Handler_write                     | 130      | 
    | Innodb_buffer_pool_pages_data     | 43       | 
    | Innodb_buffer_pool_pages_dirty    | 0        | 
    | Innodb_buffer_pool_pages_flushed  | 591      | 
    | Innodb_buffer_pool_pages_free     | 468      | 
    | Innodb_buffer_pool_pages_latched  | 0        | 
    | Innodb_buffer_pool_pages_misc     | 1        | 
    | Innodb_buffer_pool_pages_total    | 512      | 
    | Innodb_buffer_pool_read_ahead_rnd | 2        | 
    | Innodb_buffer_pool_read_ahead_seq | 0        | 
    | Innodb_buffer_pool_read_requests  | 902438   | 
    | Innodb_buffer_pool_reads          | 26       | 
    | Innodb_buffer_pool_wait_free      | 0        | 
    | Innodb_buffer_pool_write_requests | 645      | 
    | Innodb_data_fsyncs                | 2244     | 
    | Innodb_data_pending_fsyncs        | 0        | 
    | Innodb_data_pending_reads         | 0        | 
    | Innodb_data_pending_writes        | 0        | 
    | Innodb_data_read                  | 2871296  | 
    | Innodb_data_reads                 | 42       | 
    | Innodb_data_writes                | 2267     | 
    | Innodb_data_written               | 19952128 | 
    | Innodb_dblwr_pages_written        | 591      | 
    | Innodb_dblwr_writes               | 559      | 
    | Innodb_log_waits                  | 0        | 
    | Innodb_log_write_requests         | 19       | 
    | Innodb_log_writes                 | 568      | 
    | Innodb_os_log_fsyncs              | 1126     | 
    | Innodb_os_log_pending_fsyncs      | 0        | 
    | Innodb_os_log_pending_writes      | 0        | 
    | Innodb_os_log_written             | 300544   | 
    | Innodb_page_size                  | 16384    | 
    | Innodb_pages_created              | 1        | 
    | Innodb_pages_read                 | 42       | 
    | Innodb_pages_written              | 591      | 
    | Innodb_row_lock_current_waits     | 0        | 
    | Innodb_row_lock_time              | 0        | 
    | Innodb_row_lock_time_avg          | 0        | 
    | Innodb_row_lock_time_max          | 0        | 
    | Innodb_row_lock_waits             | 0        | 
    | Innodb_rows_deleted               | 1        | 
    | Innodb_rows_inserted              | 1        | 
    | Innodb_rows_read                  | 1408     | 
    | Innodb_rows_updated               | 8        | 
    | Key_blocks_not_flushed            | 0        | 
    | Key_blocks_unused                 | 14495    | 
    | Key_blocks_used                   | 2        | 
    | Key_read_requests                 | 453      | 
    | Key_reads                         | 2        | 
    | Key_write_requests                | 325      | 
    | Key_writes                        | 220      | 
    | Last_query_cost                   | 0.000000 | 
    | Max_used_connections              | 2        | 
    | Not_flushed_delayed_rows          | 0        | 
    | Open_files                        | 14       | 
    | Open_streams                      | 0        | 
    | Open_tables                       | 11       | 
    | Opened_tables                     | 0        | 
    | Qcache_free_blocks                | 1        | 
    | Qcache_free_memory                | 9986184  | 
    | Qcache_hits                       | 8350     | 
    | Qcache_inserts                    | 12       | 
    | Qcache_lowmem_prunes              | 0        | 
    | Qcache_not_cached                 | 141587   | 
    | Qcache_queries_in_cache           | 2        | 
    | Qcache_total_blocks               | 7        | 
    | Questions                         | 445733   | 
    | Rpl_status                        | NULL     | 
    | Select_full_join                  | 0        | 
    | Select_full_range_join            | 0        | 
    | Select_range                      | 0        | 
    | Select_range_check                | 0        | 
    | Select_scan                       | 1        | 
    | Slave_open_temp_tables            | 0        | 
    | Slave_retried_transactions        | 0        | 
    | Slave_running                     | OFF      | 
    | Slow_launch_threads               | 0        | 
    | Slow_queries                      | 0        | 
    | Sort_merge_passes                 | 0        | 
    | Sort_range                        | 0        | 
    | Sort_rows                         | 0        | 
    | Sort_scan                         | 0        | 
    | Table_locks_immediate             | 142108   | 
    | Table_locks_waited                | 0        | 
    | Tc_log_max_pages_used             | 0        | 
    | Tc_log_page_size                  | 0        | 
    | Tc_log_page_waits                 | 0        | 
    | Threads_cached                    | 0        | 
    | Threads_connected                 | 2        | 
    | Threads_created                   | 10       | 
    | Threads_running                   | 1        | 
    | Uptime                            | 41871    | 
    +-----------------------------------+----------+
    222 rows in set (0.02 sec)


    I had to delete some things to make it fit in the forum here, but they were all 0.

    Barry
  • I'm running 7.005 now, with 512MB RAM, and I'm seeing LOTS of CPU and RAM usage by MySQL (when I'm not using webmin).

    I'm not running any of the proxies (except DNS and NTP).

    I notice MySQL is running procs for scanning emails, etc.
    This does not make sense to me as I am not using the mail proxies or scanners!

    details:
    # uptime
    
    6:06pm  up 30 days  7:17,  1 user,  load average: 0.31, 0.61, 0.58

    top:
    PID USER      PR  NI  VIRT  RES  SHR S %CPU %MEM    TIME+  COMMAND            
    3257 mysql     16   0  385m 285m 4840 S 24.5 56.6   6411:21 mysqld     


     mysql> show processlist\G
    *************************** 1. row ***************************
         Id: 9
       User: root
       Host: localhost:48238
         db: STORAGE
    Command: Query
       Time: 1
      State: NULL
       Info: CALL getMessageToScan( "smtp", 0 )
       

    mysql> show processlist\G
    *************************** 1. row ***************************
         Id: 9
       User: root
       Host: localhost:48238
         db: STORAGE
    Command: Query
       Time: 0
      State: NULL
       Info: CALL getMessageToScan( "pop3", 0 )
       
  • More details... deleted some 0 entries due to post size limits:
    mysql> show status; 
    
    +-----------------------------------+------------+
    | Variable_name                     | Value      |
    +-----------------------------------+------------+
    | Aborted_clients                   | 6          | 
    | Aborted_connects                  | 0          | 
    | Binlog_cache_disk_use             | 0          | 
    | Binlog_cache_use                  | 0          | 
    | Bytes_received                    | 116        | 
    | Bytes_sent                        | 6443       | 
    | Com_show_processlist              | 2          | 
    | Com_show_slave_hosts              | 0          | 
    | Com_show_slave_status             | 0          | 
    | Com_show_status                   | 2          | 
    | Compression                       | OFF        | 
    | Connections                       | 12         | 
    | Created_tmp_disk_tables           | 0          | 
    | Created_tmp_files                 | 5          | 
    | Created_tmp_tables                | 2          | 
    | Delayed_errors                    | 0          | 
    | Delayed_insert_threads            | 0          | 
    | Delayed_writes                    | 0          | 
    | Flush_commands                    | 1          | 
    | Handler_read_rnd_next             | 223        | 
    | Handler_write                     | 352        | 
    | Innodb_buffer_pool_pages_data     | 43         | 
    | Innodb_buffer_pool_pages_dirty    | 0          | 
    | Innodb_buffer_pool_pages_flushed  | 34809      | 
    | Innodb_buffer_pool_pages_free     | 468        | 
    | Innodb_buffer_pool_pages_latched  | 0          | 
    | Innodb_buffer_pool_pages_misc     | 1          | 
    | Innodb_buffer_pool_pages_total    | 512        | 
    | Innodb_buffer_pool_read_ahead_rnd | 2          | 
    | Innodb_buffer_pool_read_ahead_seq | 0          | 
    | Innodb_buffer_pool_read_requests  | 63651540   | 
    | Innodb_buffer_pool_reads          | 26         | 
    | Innodb_buffer_pool_wait_free      | 0          | 
    | Innodb_buffer_pool_write_requests | 44934      | 
    | Innodb_data_fsyncs                | 128423     | 
    | Innodb_data_pending_fsyncs        | 0          | 
    | Innodb_data_pending_reads         | 0          | 
    | Innodb_data_pending_writes        | 0          | 
    | Innodb_data_read                  | 2871296    | 
    | Innodb_data_reads                 | 42         | 
    | Innodb_data_writes                | 130622     | 
    | Innodb_data_written               | 1174752256 | 
    | Innodb_dblwr_pages_written        | 34809      | 
    | Innodb_dblwr_writes               | 31809      | 
    | Innodb_log_waits                  | 0          | 
    | Innodb_log_write_requests         | 1880       | 
    | Innodb_log_writes                 | 33294      | 
    | Innodb_os_log_fsyncs              | 64804      | 
    | Innodb_os_log_pending_fsyncs      | 0          | 
    | Innodb_os_log_pending_writes      | 0          | 
    | Innodb_os_log_written             | 17997824   | 
    | Innodb_page_size                  | 16384      | 
    | Innodb_pages_created              | 1          | 
    | Innodb_pages_read                 | 42         | 
    | Innodb_pages_written              | 34809      | 
    | Innodb_row_lock_current_waits     | 0          | 
    | Innodb_row_lock_time              | 0          | 
    | Innodb_row_lock_time_avg          | 0          | 
    | Innodb_row_lock_time_max          | 0          | 
    | Innodb_row_lock_waits             | 0          | 
    | Innodb_rows_deleted               | 188        | 
    | Innodb_rows_inserted              | 189        | 
    | Innodb_rows_read                  | 668877     | 
    | Innodb_rows_updated               | 1407       | 
    | Key_blocks_not_flushed            | 0          | 
    | Key_blocks_unused                 | 14495      | 
    | Key_blocks_used                   | 2          | 
    | Key_read_requests                 | 455        | 
    | Key_reads                         | 2          | 
    | Key_write_requests                | 325        | 
    | Key_writes                        | 220        | 
    | Last_query_cost                   | 0.000000   | 
    | Max_used_connections              | 2          | 
    | Not_flushed_delayed_rows          | 0          | 
    | Open_files                        | 14         | 
    | Open_streams                      | 0          | 
    | Open_tables                       | 12         | 
    | Opened_tables                     | 0          | 
    | Qcache_free_blocks                | 1          | 
    | Qcache_free_memory                | 9986184    | 
    | Qcache_hits                       | 521356     | 
    | Qcache_inserts                    | 925        | 
    | Qcache_lowmem_prunes              | 0          | 
    | Qcache_not_cached                 | 7992414    | 
    | Qcache_queries_in_cache           | 2          | 
    | Qcache_total_blocks               | 7          | 
    | Questions                         | 25171459   | 
    | Rpl_status                        | NULL       | 
    | Select_full_join                  | 0          | 
    | Select_full_range_join            | 0          | 
    | Select_range                      | 0          | 
    | Select_range_check                | 0          | 
    | Select_scan                       | 2          | 
    | Slave_open_temp_tables            | 0          | 
    | Slave_retried_transactions        | 0          | 
    | Slave_running                     | OFF        | 
    | Slow_launch_threads               | 0          | 
    | Slow_queries                      | 0          | 
    | Sort_merge_passes                 | 0          | 
    | Sort_range                        | 0          | 
    | Sort_rows                         | 0          | 
    | Sort_scan                         | 0          | 
    | Table_locks_immediate             | 7995893    | 
    | Table_locks_waited                | 0          | 
    | Tc_log_max_pages_used             | 0          | 
    | Tc_log_page_size                  | 0          | 
    | Tc_log_page_waits                 | 0          | 
    | Threads_cached                    | 0          | 
    | Threads_connected                 | 2          | 
    | Threads_created                   | 11         | 
    | Threads_running                   | 1          | 
    | Uptime                            | 2617992    | 
    +-----------------------------------+------------+
  • According to webmin, there is 1 message in the quarantine, but when I open quarantine manager, there is nothing.

    I don't know if this is related to all the mysql activity.

    Barry
  • Screenshot of my dashboard attached