High loads on mysql after 4.2 upgrade

halalrizik2841

New Member
YetiShare User
Aug 5, 2013
40
0
0
My server goes out of memory everyday after the 4.2 upgrade. I have tried several things to optimize mysql but could not solve this.

I get the below email everyday and when i check the server it show very high loads and then mysql goes down, which i have to restart :

Out of memory: The process “mysqld” was terminated because the system is low on memory.
In order to avoid a system crash due to low memory, the kernel terminated the process named “mysqld” with the process ID “24638”.
Server server.fileloby.com
Primary IP Address 109.200.202.69
Process Name mysqld
Event Time Sunday, December 27, 2015 12:21:21 PM UTC
Process ID 24638
Process UID 498
Process Username mysql
Process Total Virtual Memory 9722116kB
Process Anonymous Resident Set Size 290496kB
Process File Resident Set Size 780kB
Process OOM Score 43
Status Out of Memory ⚠
Memory Information
Used 3.29 GB
Available 12.27 GB
Installed 15.57 GB
Load Information 0.55 54.04 140.76
Uptime 8 days, 1 hour, 59 minutes, and 17 seconds
IOStat Information avg-cpu: %user %nice %system %iowait %steal %idle
16.42 0.02 16.28 0.91 0.00 66.37
Device: tps Blk_read/s Blk_wrtn/s Blk_read Blk_wrtn
sda 95.46 15070.54 566.65 10524614232 395722192
Top Processes
PID Owner CPU % Memory % Command
30875 mysql 1.26 5.23 /usr/sbin/mysqld --basedir=/usr --datadir=/var/lib/mysql --plugin-dir=/usr/lib64/mysql/plugin --user=mysql --log-error=/var/lib/mysql/server.fileloby.com.err --open-files-limit=19850 --pid-file=/var/lib/mysql/server.fileloby.com.pid
26203 nobody 3.98 1.27 /usr/local/apache/bin/httpd -k start -DSSL
22859 nobody 3.81 1.22 /usr/local/apache/bin/httpd -k start -DSSL
27368 nobody 4.49 1.20 /usr/local/apache/bin/httpd -k start -DSSL
26561 nobody 4.17 1.16 /usr/local/apache/bin/httpd -k start -DSSL
For addtional details, please see the attached dmesg log dump.

Preview of “oom_dmesg.txt”
[697812.634358] [29646] 0 29646 40095 1442 1 0 0 lfd - (child) c
[697812.634362] [29647] 0 29647 40095 2192 0 0 0 lfd - (child) c
[697812.634365] [29648] 99 29648 19781 253 5 0 0 httpd
[697812.634368] [29649] 0 29649 19781 192 6 0 0 httpd
[697812.634371] [29650] 99 29650 19781 253 7 0 0 httpd
[697812.634375] [29651] 99 29651 19781 253 6 0 0 httpd
[697812.634378] [29652] 99 29652 19781 252 4 0 0 httpd
[697812.634381] [29653] 99 29653 19781 252 6 0 0 httpd
[697812.634384] Out of memory: Kill process 24638 (mysqld) score 43 or sacrifice child
[697812.634412] Killed process 24638, UID 498, (mysqld) total-vm:9722116kB, anon-rss:290496kB, file-rss:780kB
 

adam

Administrator
Staff member
Dec 5, 2009
2,046
108
63
I can't see it relating directly to the 4.2 upgrade, the amount of queries on the db has been significantly reduced.

What is actually causing the high loads? i.e. if you run a 'top' what does it show. (when it's going slow) Sometimes mysql failing can be a side effect of another process using up too much resources.

Also ensure you have all these settings:

https://support.mfscripts.com/public/kb_view/27/
 

enricodias4654

Member
YetiShare User
Jan 13, 2015
411
1
16
You can tweek the my.cnf file to prevent mysql from using all memory. You can also increase your swap to prevent system crash.