The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Why am I constantly running out of memory?

Discussion in 'Workarounds and Optimization' started by Rasmusbdk, Apr 21, 2017.

Tags:
  1. Rasmusbdk

    Rasmusbdk Member

    Joined:
    Dec 3, 2015
    Messages:
    20
    Likes Received:
    0
    Trophy Points:
    1
    Location:
    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.
     
    #1 Rasmusbdk, Apr 21, 2017
    Last edited by a moderator: Apr 21, 2017
  2. Rasmusbdk

    Rasmusbdk Member

    Joined:
    Dec 3, 2015
    Messages:
    20
    Likes Received:
    0
    Trophy Points:
    1
    Location:
    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?
     
    #2 Rasmusbdk, Apr 21, 2017
    Last edited by a moderator: Apr 21, 2017
  3. SysSachin

    SysSachin Well-Known Member

    Joined:
    Aug 23, 2015
    Messages:
    542
    Likes Received:
    39
    Trophy Points:
    28
    Location:
    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
     
  4. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    36,999
    Likes Received:
    1,275
    Trophy Points:
    363
    cPanel Access Level:
    Root Administrator
Loading...

Share This Page