Skip to main content

OOM killing mysql process

Comments

7 comments

  • cPanelMichael
    Hello :) Could you post your /etc/my.cnf configuration? Thank you.
    0
  • 63bus
    Here you go. The table_open_cache and open_files_limit were lower when this problem occurred yesterday and in the past, I increased those as I was trying to minimize the growth of the opened_files parameter. I also just removed default-storage-engine=MyISAM as that is no longer needed. I am using mySQL 5.6.29 Side note: Ever since my system upgraded to WHM 54 I have been having some performance issues. Restarting the database typically solves it for a day or 2.
    [mysqld] performance_schema=off innodb_ft_min_token_size=2 ft_min_word_len=2 slow-query-log=0 long_query_time=1 read_buffer_size=2M max_allowed_packet=500M read_rnd_buffer_size=8M wait_timeout=15 interactive_timeout=15 max_connections=150 table_open_cache=12000 table_open_cache_instances=8 datadir="/var/lib/mysql" thread_cache_size=150 sort_buffer_size=2M join_buffer_size=2M key_buffer_size=256M query_cache_type=1 query_cache_limit=512K query_cache_size=32M query_cache_min_res_unit=2048 basedir="/usr/" max_heap_table_size=32M tmp_table_size=32M myisam_sort_buffer_size=64M innodb_file_per_table=1 innodb_buffer_pool_size=10G innodb_log_file_size=256M innodb_log_buffer_size=8M innodb_flush_log_at_trx_commit=2 innodb_flush_method=O_DIRECT innodb-file-format=Barracuda innodb_write_io_threads=16 innodb_read_io_threads=16 open_files_limit=25000 default-storage-engine=MyISAM [safe_mysqld] err-log="/var/log/mysqld.log"
    Here's a run of SQLTuner too, if that adds any information
    >> MySQLTuner 1.6.2 - Major Hayden >> Bug reports, feature requests, and downloads at http://mysqltuner.com/ >> Run with '--help' for additional options and output filtering [--] Skipped version check for MySQLTuner script [OK] Currently running supported MySQL version 5.6.29 [OK] Operating on 64-bit architecture -------- Storage Engine Statistics ------------------------------------------- [--] Status: +ARCHIVE +BLACKHOLE +CSV -FEDERATED +InnoDB +MRG_MYISAM [--] Data in MyISAM tables: 1G (Tables: 90) [--] Data in InnoDB tables: 8G (Tables: 32) [!!] Total fragmented tables: 30 -------- Security Recommendations ------------------------------------------- [OK] There are no anonymous accounts for any database users [OK] All database users have passwords assigned [!!] There is no basic password file list! -------- CVE Security Recommendations ------------------------------------------- [--] Skipped due to --cvefile option undefined -------- Performance Metrics ------------------------------------------------- [--] Up for: 20h 26m 35s (8M q [116.413 qps], 1M conn, TX: 17B, RX: 1B) [--] Reads / Writes: 62% / 38% [--] Binary logging is disabled [--] Total buffers: 10.3G global + 14.2M per thread (150 max threads) [OK] Maximum reached memory usage: 10.6G (66.03% of installed RAM) [OK] Maximum possible memory usage: 12.4G (77.60% of installed RAM) [OK] Slow queries: 0% (4K/8M) [OK] Highest usage of available connections: 11% (17/150) [OK] Aborted connections: 0.00% (0/1484377) [OK] Query cache efficiency: 33.9% (1M cached / 3M selects) [!!] Query cache prunes per day: 93988 [OK] Sorts requiring temporary tables: 0% (143 temp sorts / 97K sorts) [!!] Temporary tables created on disk: 31% (38K on disk / 121K total) [OK] Thread cache hit rate: 99% (17 created / 1M connections) [OK] Table cache hit rate: 99% (1K open / 1K opened) [OK] Open file limit used: 4% (1K/24K) [OK] Table locks acquired immediately: 99% (5M immediate / 5M locks) -------- MyISAM Metrics ----------------------------------------------------- [!!] Key buffer used: 36.1% (96M used / 268M cache) [OK] Key buffer size / total MyISAM indexes: 256.0M/380.2M [OK] Read Key buffer hit rate: 99.9% (31M cached / 44K reads) [!!] Write Key buffer hit rate: 45.4% (687K cached / 375K writes) -------- InnoDB Metrics ----------------------------------------------------- [--] InnoDB is enabled. [OK] InnoDB buffer pool / data size: 10.0G/8.7G [!!] InnoDB buffer pool instances: 8 [!!] InnoDB Used buffer: 71.21% (466673 used/ 655356 total) [OK] InnoDB Read buffer efficiency: 99.99% (2875664791 hits/ 2876089716 total) [!!] InnoDB Write buffer efficiency: 0.00% (0 hits/ 1 total) [OK] InnoDB log waits: 0.00% (0 waits / 759314 writes) -------- AriaDB Metrics ----------------------------------------------------- [--] AriaDB is disabled. -------- Replication Metrics ------------------------------------------------- [--] No replication slave(s) for this server. [--] This is a standalone server.. -------- Recommendations ----------------------------------------------------- General recommendations: Run OPTIMIZE TABLE to defragment tables for better performance MySQL started within last 24 hours - recommendations may be inaccurate When making adjustments, make tmp_table_size/max_heap_table_size equal Reduce your SELECT DISTINCT queries which have no LIMIT clause Variables to adjust: query_cache_size (> 32M) tmp_table_size (> 32M) max_heap_table_size (> 32M) innodb_buffer_pool_instances(=10)
    0
  • cPanelMichael
    Have you tried updating the values as suggested under "Variables To Adjust" in the tuner output to see if that helps? Thank you.
    0
  • 63bus
    I have adjusted them in the past and they have been at higher values when this problem was occurring 1-2 weeks ago. Can you explain how adjusting those parameters will affect why OOM seems to think that the system is out of memory when this does appear to be correct?
    0
  • cPanelMichael
    The output you provided suggests MySQL was using the most memory when it was killed. Thus, tuning the MySQL performance is one way to reduce it's usage. That said, I suggest consulting with a qualified system administrator for help with determining the cause of the memory issues on your system if this continues to happen, as this is not a cPanel function or feature that's killing the process. Thank you.
    0
  • 63bus
    Thank you, I understand. I mistakenly thought OOM and it's ability to kill processes was a new feature of WHM as this never occurred before the 11.54 upgrade. I will work on examining and optimizing my mySQL configuration and memory usage.
    0
  • storminternet
    Additionally monitor the users and their databases overloading server by using mysqladmin pr and find out culprit user.
    0

Please sign in to leave a comment.