Why am I constantly running out of memory?

Rasmusbdk

Member
Dec 3, 2015
20
0
1
Denmark
cPanel Access Level
Root Administrator
I am running a VPS with 1024 mb ram that is hosting a single WordPress site. Lately I have been having a lot of database problems where WordPress is giving me "Error establishing a database connection". I can make the server crash just by crawling it with Screaming Frog SEO tool.

Sometimes the issue resolves itself, sometimes I need to manually restart MySQL, and other times I have to completely reboot the server.

I thought the error was related to MySQL itself, but after examining the various logs, it seems like my server is running out of memory and therefore simply killing MySQL.

I have been running ´top´ from command line, but can't figure out what's causing the problem. When accessing the server status in WHM I am using around 70 % of ram most of the time.

Would really appreciate some suggestions as how to proceed from here to figure out what is consuming my memory and causing the issues.

Thanks!

However - the daily proces logs mentions an average memory usage of 30 % most days.
 
Last edited by a moderator:

Rasmusbdk

Member
Dec 3, 2015
20
0
1
Denmark
cPanel Access Level
Root Administrator
I might have found out more about the issue. These are results from Mysqltuner:

oi63.tinypic.com/2qvawci.jpg

My settings from my.cnf:

[mysqld]
max_allowed_packet=268435456
open_files_limit=10000
innodb_buffer_pool_size = 128M
innodb_log_file_size = 128M
key_buffer_size = 64M
innodb_file_per_table
slow_query_log=1
slow_query_log_file="/var/log/slowqueries"
long_query_time = 3
general_log=1
general_log_file="/var/lib/mysql/generalqueries"


Should I simply lower my buffers?
 
Last edited by a moderator:

SysSachin

Well-Known Member
Aug 23, 2015
604
48
28
India
cPanel Access Level
Root Administrator
Twitter
Hi,

I think free memory is not available on your server and due to that mysql process killed.

You have to check memory status using command free -m

Also, check logs in the file if showing process kill log

tail -n 5000 /var/log/messages | grep kill

the above command will show the kill process logs