Results 1 to 19 of 19
  1. #1
    Join Date
    Mar 2011
    Posts
    80

    VPS using too much RAM memory

    Hello.

    I have a VPS with 4 GB of dedicated RAM memory (OpenVZ) with cPanel installed on it.

    However I noticed some strange thing going on. Even when there is almost no one on the websites (for example 3-4 am) very few probably, RAM memory usage is around 2.5 GB!

    How is that possible if almost no one is there? I noticed also when I restart my VPS, RAM rapidly go up 2 GB and more.

    Why? Is there advice so I can lower that? I'm not running anything special really, SMF forums and one portal, but there is no activity now for example and RAM memory usage is 2.5 GB...

    If anyone have some advice, I would be thankful.

  2. #2
    Join Date
    Feb 2006
    Location
    Kepler 62f
    Posts
    16,699
    Type "top" in shell and see what's running.
    || Need a good host?
    || See my Suggested Hosts List || Editorial: EIG/Site5/Arvixe/Hostgator Alternatives
    ||

  3. #3
    Join Date
    Mar 2011
    Posts
    80
    Quote Originally Posted by kpmedia View Post
    Type "top" in shell and see what's running.
    top - 07:38:24 up 1 day, 4:32, 1 user, load average: 1.44, 1.04, 0.86
    Tasks: 40 total, 1 running, 39 sleeping, 0 stopped, 0 zombie
    Cpu(s): 6.6%us, 4.2%sy, 0.0%ni, 89.2%id, 0.0%wa, 0.0%hi, 0.0%si, 0.0%st
    Mem: 4097152k total, 2445060k used, 1652092k free, 0k buffers
    Swap: 0k total, 0k used, 0k free, 0k cached


    And almost no one is on those websites now...

  4. #4
    Join Date
    Feb 2006
    Location
    Kepler 62f
    Posts
    16,699
    Okay .. but what is running?
    There should be a list of processes shown.
    || Need a good host?
    || See my Suggested Hosts List || Editorial: EIG/Site5/Arvixe/Hostgator Alternatives
    ||

  5. #5
    Join Date
    Sep 2010
    Posts
    269
    While top is active, press "Shift + M" to sort the results by RAM used.

  6. #6

  7. #7
    Join Date
    Jul 2009
    Location
    In the Datacenter.
    Posts
    127
    Quote Originally Posted by nodokodo View Post
    I was just about to link this.

    OP: Copy and fast the 'free -m' read out for us.
    SonicVPS.com - Automated VPS Provisioning

  8. #8
    Join Date
    Feb 2012
    Location
    9PLR.COM
    Posts
    6
    Wow.. process running to high.
    Actually you use a thumail resize image scripts or something else.

  9. #9
    Join Date
    Mar 2011
    Posts
    80
    Quote Originally Posted by bloghaiti View Post
    Wow.. process running to high.
    Actually you use a thumail resize image scripts or something else.
    This is probably part of portal that is on the VPS..do you have any suggestion about this?

    Thanks!

  10. #10
    Join Date
    Mar 2011
    Posts
    80
    Quote Originally Posted by Ghan_04 View Post
    While top is active, press "Shift + M" to sort the results by RAM used.
    But none of the processes use so much RAM...don't know where all is gone...and sometimes I'm getting internal server error because process cannot alocate memory, so it eats up all the RAM available.

    But the strange thing is that when almost no one is on those websites, 2.5 GB RAM is used?

    Thanks

  11. #11
    Join Date
    Feb 2012
    Location
    9PLR.COM
    Posts
    6
    Disable thumbnail image on posts. or try another theme. or try to show less images on thumbnail.

  12. #12
    Join Date
    Oct 2008
    Posts
    637
    1. You are using OpenVZ with burstable memory. Memory usage will reported to be much higher than actual.

    2. Paste your Apache config
    /etc/httpd/conf/extra/httpd-mpm.conf

    I'm guessing you're using prefork with "startservers" being set too high.


    Tuxlite.com Complete LAMP and LNMP script for Debian and Ubuntu.

  13. #13
    Join Date
    Mar 2011
    Posts
    80
    Quote Originally Posted by Scientist View Post
    1. You are using OpenVZ with burstable memory. Memory usage will reported to be much higher than actual.

    2. Paste your Apache config
    /etc/httpd/conf/extra/httpd-mpm.conf

    I'm guessing you're using prefork with "startservers" being set too high.
    #
    # Server-Pool Management (MPM specific)
    #

    #
    # PidFile: The file in which the server should record its process
    # identification number when it starts.
    #
    # Note that this is the default PidFile for most MPMs.
    #
    <IfModule !mpm_netware_module>
    PidFile "logs/httpd.pid"
    </IfModule>

    #
    # The accept serialization lock file MUST BE STORED ON A LOCAL DISK.
    #
    <IfModule !mpm_winnt_module>
    <IfModule !mpm_netware_module>
    LockFile "logs/accept.lock"
    </IfModule>
    </IfModule>

    #
    # Only one of the below sections will be relevant on your
    # installed httpd. Use "apachectl -l" to find out the
    # active mpm.
    #

    # prefork MPM
    # StartServers: number of server processes to start
    # MinSpareServers: minimum number of server processes which are kept spare
    # MaxSpareServers: maximum number of server processes which are kept spare
    # MaxClients: maximum number of server processes allowed to start
    # MaxRequestsPerChild: maximum number of requests a server process serves
    <IfModule mpm_prefork_module>
    StartServers 5
    MinSpareServers 5
    MaxSpareServers 10
    MaxClients 150
    MaxRequestsPerChild 0
    </IfModule>

    # worker MPM
    # StartServers: initial number of server processes to start
    # MaxClients: maximum number of simultaneous client connections
    # MinSpareThreads: minimum number of worker threads which are kept spare
    # MaxSpareThreads: maximum number of worker threads which are kept spare
    # ThreadsPerChild: constant number of worker threads in each server process
    # MaxRequestsPerChild: maximum number of requests a server process serves
    <IfModule mpm_worker_module>
    StartServers 2
    MaxClients 150
    MinSpareThreads 25
    MaxSpareThreads 75
    ThreadsPerChild 25


    MaxSpareThreads 75
    ThreadsPerChild 25
    MaxRequestsPerChild 0
    </IfModule>

    # BeOS MPM
    # StartThreads: how many threads do we initially spawn?
    # MaxClients: max number of threads we can have (1 thread == 1 client)
    # MaxRequestsPerThread: maximum number of requests each thread will process
    <IfModule mpm_beos_module>
    StartThreads 10
    MaxClients 50
    MaxRequestsPerThread 10000
    </IfModule>

    # NetWare MPM
    # ThreadStackSize: Stack size allocated for each worker thread
    # StartThreads: Number of worker threads launched at server startup
    # MinSpareThreads: Minimum number of idle threads, to handle request spikes
    # MaxSpareThreads: Maximum number of idle threads
    # MaxThreads: Maximum number of worker threads alive at the same time
    # MaxRequestsPerChild: Maximum number of requests a thread serves. It is
    # recommended that the default value of 0 be set for this
    # directive on NetWare. This will allow the thread to
    # continue to service requests indefinitely.
    <IfModule mpm_netware_module>
    ThreadStackSize 65536
    StartThreads 250
    MinSpareThreads 25
    MaxSpareThreads 250
    MaxThreads 1000
    MaxRequestsPerChild 0
    MaxMemFree 100
    </IfModule>

    # OS/2 MPM
    # StartServers: Number of server processes to maintain
    # MinSpareThreads: Minimum number of idle threads per process,
    # to handle request spikes
    # MaxSpareThreads: Maximum number of idle threads per process
    # MaxRequestsPerChild: Maximum number of connections per server process
    <IfModule mpm_mpmt_os2_module>
    StartServers 2
    MinSpareThreads 5
    MaxSpareThreads 10
    MaxRequestsPerChild 0
    </IfModule>

    # WinNT MPM
    # ThreadsPerChild: constant number of worker threads in the server process
    # MaxRequestsPerChild: maximum number of requests a server process serves
    <IfModule mpm_winnt_module>
    ThreadsPerChild 150
    MaxRequestsPerChild 0
    </IfModule>
    I guess I enabled Worker yesterday but still my RAM memory usage is high...

    Thanks.

  14. #14
    Join Date
    Mar 2011
    Posts
    80
    Quote Originally Posted by bloghaiti View Post
    Disable thumbnail image on posts. or try another theme. or try to show less images on thumbnail.
    This can be the real cause I think.

    Do you mean to disable thumbnail within the script I'm using? I'm using Vivvo CMS for portal solution (www.vivvo.net)

    And why does thumbnail take so much RAM...

  15. #15
    Join Date
    Jun 2011
    Location
    Internet
    Posts
    2,985
    You could always try switching to nginx. It's generally more memory efficient. Although, this likely isn't the cause of the issue.

  16. #16
    Join Date
    Mar 2011
    Posts
    80
    Quote Originally Posted by Flapadar View Post
    You could always try switching to nginx. It's generally more memory efficient. Although, this likely isn't the cause of the issue.
    That's probably not an easy thing to do?

  17. #17
    Join Date
    Jun 2011
    Location
    Internet
    Posts
    2,985
    Installing nginx isn't too hard. There's tutorials all over the internet for it.

  18. #18
    Join Date
    Mar 2011
    Posts
    80
    Are there any statistic how much ngnix can reduce memory and resource usage?

    Thanks.

  19. #19
    Join Date
    Nov 2005
    Posts
    3,944
    @OP:

    Worker mpm tends to allocate a lot of memory with OpenVZ, so it will show a lot used even when the server is idle. This isn't necessarily a problem because when traffic starts pouring in, the RAM usage shouldn't increase too much. It will just start using what it allocated.

    If your concerned, I recommend switching back to prefork. You could also consider turning off KeepAlive. KeepAlive saves CPU and load times but uses more memory.

Similar Threads

  1. Replies: 3
    Last Post: 12-20-2010, 05:10 PM
  2. Committed memory higher than available memory on VPS
    By tnedator in forum Hosting Security and Technology
    Replies: 0
    Last Post: 02-15-2010, 02:27 PM
  3. Cpanel VPS - Plenty of free memory, but 'committed' memory exceeds VPS RAM. Why?
    By tnedator in forum Hosting Security and Technology
    Replies: 3
    Last Post: 06-12-2009, 02:56 PM
  4. OpenVZ with 256 ram assigned, Plesk errors and vps memory full
    By Hostenlinea in forum Hosting Security and Technology
    Replies: 2
    Last Post: 10-21-2008, 07:43 PM
  5. windows VPS & memory (ram)
    By dirkb in forum VPS Hosting
    Replies: 13
    Last Post: 06-28-2006, 02:49 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •