Welcome to the JaguarPC Community
JaguarPC
Sales: (888) 338-5261
Support: (888)-551-3050
Results 1 to 10 of 10

This is a discussion on VPS High Memory Usage in the VPS & Dedicated forum
Hi people, I have a VPS account here at Jag and though I don't encounter a lot of problems (save for the occasional hickups like ...

  1. #1
    Loyal Client
    Join Date
    May 2009
    Posts
    18

    VPS High Memory Usage

    Hi people, I have a VPS account here at Jag and though I don't encounter a lot of problems (save for the occasional hickups like yesterday). But having said that, the site speed is less than appealing. To be blunt, it is terribly slow. I only run httpd+php+mysqld on that VPS as I only use wordpress. My

    The workaround that I do now is to restart the httpd+mysqld services but I have to do that several times a day. Now, my questions are:
    1. For VPS One clients, what is the httpd.conf and my.cnf optimization settings that you use?
    2. What can is the setting to let apache run on lesser memory. I read somewhere here that they are running apache using only ~130MB of memory. How can I achieve that?
    3.What optimizer do you use/recommend?

    Take note that my sites sitting on that server has WP-SuperCache running and the total aggregate visitors daily is just a little over 2000.

  2. #2
    Loyal Client
    Join Date
    Feb 2010
    Posts
    18
    I'm not sure what is going on, but here are some things to consider:

    How is your PHP installed?

    Is it installed as an Apache module or are you using suPHP or FastCGI?

    If you use the Apache module or FastCGI, you can use a PHP op-code cache like APC or eAccelerator which will speed up PHP execution time at the expense of more RAM (since the PHP scripts are cached in RAM).

    You can lower your RAM usage if you disable unneeded Apache modules or PHP extensions.

    If rebooting helps restore speed, you might have a memory leak somewhere. You might want to reduce the MaxRequestsPerChild setting in httpd.conf.

    Also, are you using the MySQL query cache?

  3. #3
    Loyal Client
    Join Date
    May 2009
    Posts
    18
    I appreciate your reply and already expected you might need to see my settings.

    Here's my relevant httpd.conf entries

    loaded modules
    Code:
    LoadModule authz_host_module modules/mod_authz_host.so
    LoadModule log_config_module modules/mod_log_config.so
    LoadModule expires_module modules/mod_expires.so
    LoadModule deflate_module modules/mod_deflate.so
    LoadModule headers_module modules/mod_headers.so
    LoadModule setenvif_module modules/mod_setenvif.so
    LoadModule mime_module modules/mod_mime.so
    LoadModule autoindex_module modules/mod_autoindex.so
    LoadModule dir_module modules/mod_dir.so
    LoadModule alias_module modules/mod_alias.so
    LoadModule rewrite_module modules/mod_rewrite.so
    LoadModule proxy_module modules/mod_proxy.so
    here's my prefork settings
    Code:
    <IfModule prefork.c>
    StartServers       3
    MinSpareServers    3
    MaxSpareServers   10
    ServerLimit      20
    MaxClients       20
    MaxRequestsPerChild  500
    </IfModule>
    The MaxRequestsPerChild was set to 2000 before I subnmit my original post. I have since change it to 500. After the change, it's now hovering between 270-320MB. That's well above my guaranteed RAM but at least it is not that far.

    Next I'll change is the MaxSpareServers set to 8.

    As far as PHP is concerned, I honestly don't know. I'm using the whatever is originally set for CentOS. I have no accelerator installed because I already use more than my memory allocation.

  4. #4
    Loyal Client
    Join Date
    Feb 2010
    Posts
    18
    Your settings look pretty standard to me although I suppose you could make a tweak or two.

    I doubt you are using mod_proxy. You probably don't need mod_deflate either since Wordpress usually uses PHP to gzip the output already.

    It is a mystery to me how your PHP is setup. I expect to see mod_php, mod_fastcgid, mod_suphp or even mod_cgi in your module list.

    I would activate the MySQL query cache even if it will eat up a bit of your precious RAM - the performance gains are usually worth it.

    Try adding the following to my.cnf

    query_cache_type = 1
    query_cache_size = 16M

  5. #5
    Loyal Client
    Join Date
    May 2009
    Posts
    18
    I'll check on that. Here's my current mysql settings.

    Code:
    max_connections = 400
    key_buffer = 16M
    myisam_sort_buffer_size = 32M
    join_buffer_size = 1M
    read_buffer_size = 1M
    sort_buffer_size = 2M
    table_cache = 1024
    thread_cache_size = 286
    interactive_timeout = 25
    wait_timeout = 1000
    connect_timeout = 10
    max_heap_table_size = 128M
    max_allowed_packet = 16M
    max_connect_errors = 10
    read_rnd_buffer_size = 524288
    bulk_insert_buffer_size = 16M
    query_cache_limit = 1M
    query_cache_size = 16M
    query_cache_type = 1
    query_prealloc_size = 163840
    query_alloc_block_size = 32768
    tmp_table_size = 16M
    skip-innodb

  6. #6
    Loyal Client thisisit3's Avatar
    Join Date
    Mar 2007
    Posts
    642
    You did not tell us how much memory you have in your VPS.

    I suggest you try my memory script (see my signature) and copy/paste the result of the script here.

  7. #7
    Loyal Client
    Join Date
    May 2009
    Posts
    18
    the memory limit is 256MB. the hard limit is 1GB and there's a script placed by jpc (mem.sh) that tells me what I currently using. as I have said, it is now hovering between 270-300. But now, it's hovering to 500mb again. probably because it's monday(a weekday) thus those who access the site from the office is higher.

  8. #8
    Loyal Client thisisit3's Avatar
    Join Date
    Mar 2007
    Posts
    642
    256MB? haha man sorry to bring the bad news to you, but with such low memory you shouldn't expect to run anything more than 1-2 web sites (and with cPanel, one is more than enough).

    First of all, upgrade your memory to 512MB to very least. Anything less is just not going to cut it.

    Then, you have to play with cPanel to get better memory usage. For example, one of the worst things is the mailman mailing list system, if you don't need it, then disable it and remove it from starting up. Also, switch to NSD instead of BIND, that should also save a lot of memory. Finally, switch to DOVECOT, Courier is bad news for memory usage.

    So here it is:

    1) Buy more memory (your total should be at least 512MB)
    2) Stop and disable mailman from running
    3) Switch to NSD
    4) Switch to Dovecot

    Once over, you'll be in a much better state than previously and everything will run fine.


    PS:
    A small complaint from me about Jag: Its immoral to sell 256MB VPS hosting to people, since you know that with that much memory they can barely boot cPanel and almost always these people buy more memory. C'mon, you know that 256 is just too low.

  9. #9
    Loyal Client
    Join Date
    May 2009
    Posts
    18
    Actually, I'm not using cpanel. the things installed on my vps are the following:
    apache
    mysql
    pureftpd
    php

    I basically manually do everything else that could have been automated by cPanel. The reason why I did not install cPanel is because I know it will eat up almost 256mb all by itself. So no mailman and other things. I don't even have DNS server. It's almost plain vanilla centos that Jagpc provides.

    Also, the memory usage is only at <50MB when apache is not running. And then it hits the limit once I start it. So I'm thinking that it's on the apache+php+mysql which has having problem or the site itself.

    I managed to track down one of the reasons. A test site running gorilla theme(smooth) is killing my server. After switching back to default theme, memory usage went back to 300 range. It no longer goes beyond that. I'll check what is that in smooth theme that's causing this issue.

  10. #10
    Loyal Client thisisit3's Avatar
    Join Date
    Mar 2007
    Posts
    642
    ok I admit I might have overreacted there

    which version of apache are you using? if its 2.x then its important to check on how many live threads you have.

Bookmarks

Posting Permissions

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