Results 1 to 12 of 12
  1. #1
    Join Date
    Mar 2012
    Location
    Uttara, Dhaka-1230.
    Posts
    271

    Exclamation Swap is being Used before Ram Usage

    Hi,
    I have a VPS with 1 GB Ram (768 MB Guaranteed + 256 MB Burst/Swap) & cPanel Running.

    I can see it's using Swap More while I have Guaranteed Ram free. While I was writing the post, it came normal now.

    System information

    Server load 0.17 (4 CPUs)
    Memory Used 33.73% (265,280 of 786,432)
    Swap Used 56.66% (148,520 of 262,144)
    But, before this, the Swap usage was about 90-92 Percent & A Red Icon was blinking ! Can anyone tell me what to do so that it uses My Ram before Swap !
    Sync Serve Serving Hosting Freedom
    Shared - Reseller - VPS Hosting | SSL Certificates | 7 Days Money Back Guarantee |
    Germany Server | Redundant Network | 99.9% Uptime | CloudFlare Optimized Partner
    Proud to be A Bangladeshi !

  2. #2
    Join Date
    Feb 2006
    Location
    Global
    Posts
    1,628
    Who's your VPS provider?
    You could try run command 'free -m' from SSH and post the results, removing any thing you see as private/sensitive.

  3. #3
    Join Date
    Apr 2007
    Location
    US, UK, Europe, ME
    Posts
    258
    It seems that your VPS is not optimized properly, You need to optimize and tweak your services correctly. It would be helpful to provide us with the output of "free -m" , The content of your "/etc/my.cnf" and your webserver (Apache?)settings & values from the httpd.conf config file.

  4. #4
    Join Date
    May 2012
    Location
    India
    Posts
    1,026

  5. #5
    Join Date
    Dec 2007
    Location
    Indiana, USA
    Posts
    16,087
    If it bothers you, perhaps set 'swappiness' to something lower than 60.
    http://linux.cloudibee.com/2007/11/l...vm-swappiness/

    Honestly - unless it's affecting your performance - I wouldn't worry about it. There's nothing wrong with the system taking inactive pages out of RAM and putting them into SWAP to clear up more RAM for active pages.
    Michael Denney - MDDHosting LLC
    New shared plans for 2016! Check them out!
    Highly Available Shared, Premium, Reseller, and VPS
    http://www.mddhosting.com/

  6. #6
    Join Date
    Apr 2011
    Location
    Core Files
    Posts
    7,801
    Also take into account, cpanel/apache is already using a good amount of memory before the account does anything else.

    1. Optimizing

    If this doesn't work after guaranteed attempts

    2. upgrade to next package or talk to host about specific needs

  7. #7
    Join Date
    Dec 2012
    Location
    New York
    Posts
    382
    +1 If your requirements are growing, I would suggest you to go for an upgrade but before making a decision consult your hosting provider.
    Hostpaedia - Affordable, Reliable & Secure Web Hosting
    Web Hosting : Host Unlimited Websites, cPanel, Softaculous, Servers in USA and Germany
    Reseller Hosting : cPanel, Softaculous
    VPS Hosting : KVM VPS powered by Virtualizor

  8. #8
    Join Date
    Mar 2012
    Location
    Uttara, Dhaka-1230.
    Posts
    271
    Quote Originally Posted by Sys Admin View Post
    It seems that your VPS is not optimized properly, You need to optimize and tweak your services correctly. It would be helpful to provide us with the output of "free -m" , The content of your "/etc/my.cnf" and your webserver (Apache?)settings & values from the httpd.conf config file.
    [email protected] [~]# free -mt
    total used free shared buffers cached
    Mem: 768 724 43 0 0 533
    -/+ buffers/cache: 190 577
    Swap: 256 243 12
    Total: 1024 967 56
    Contents of /etc/my.cnf:

    [mysqld]
    innodb_file_per_table=1
    I'm using NginxCP, so don't know where it's config file is located !
    Sync Serve Serving Hosting Freedom
    Shared - Reseller - VPS Hosting | SSL Certificates | 7 Days Money Back Guarantee |
    Germany Server | Redundant Network | 99.9% Uptime | CloudFlare Optimized Partner
    Proud to be A Bangladeshi !

  9. #9
    Join Date
    Aug 2008
    Location
    UK, Major Cities
    Posts
    499
    Not fully in touch with the newer types of virtualization. Don't these VPS's swap onto a separate hard drive, usually an SSD? As to not affect your performance and have fast swapping power.

    Just because free -m shows "swap" usage, it doesn't necessarily mean its swapping.

    Is your load elevated? Check $ iostat, what's the wait? Run:

    $ vmstat 1 or $vmstat and look for si (swap in) so (swap out), it will most probably be 0, which means your VPS is not swapping, it just has data stored on the swap partition.
    - Colin Dunn | Systems Administrator
    I think CentOS is a pretty cool guy. eh runs mah server and doesnt afraid of anything...
    ^ That sig/meme is so old, I just don't have the heart to change it. I hope the cool kids around still get it... 2008 was a good year!

  10. #10
    Join Date
    Nov 2006
    Location
    search.php?do=getnew
    Posts
    1,238
    <Thread moved to more suitable category>

  11. #11
    Join Date
    Nov 2009
    Location
    /etc/my.cnf
    Posts
    10,041
    Quote Originally Posted by Mahfuz-SS-EHL View Post
    Swap Used 56.66% (148,520 of 262,144)
    Judging by this your swap is too small anyway it should be at least twice your ram as per cPanel partition guidelines.

  12. #12
    Join Date
    May 2013
    Location
    India
    Posts
    748
    Its an OpenVZ based container I believe and the provider use vSWAP ( with their legacy memory modelling, swap shows as 0 ). Anyway if your instance is running fine and swap space is being cleared automatically, there isn't anything to worry about normally.

Similar Threads

  1. No SWAP usage
    By DjMiX in forum Dedicated Server
    Replies: 9
    Last Post: 10-15-2007, 02:30 PM
  2. Lighttpd - 95% Cpu Usage. Apache - All Ram Used, Swap Comes In
    By Greedisgood in forum Hosting Security and Technology
    Replies: 18
    Last Post: 10-14-2007, 12:34 PM
  3. Replies: 2
    Last Post: 08-02-2007, 12:05 AM
  4. Replies: 7
    Last Post: 07-21-2007, 05:11 PM
  5. Swap Usage
    By mellow-h in forum Hosting Security and Technology
    Replies: 5
    Last Post: 04-23-2006, 03:29 AM

Tags for this Thread

Posting Permissions

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