hosted by liquidweb


Go Back   Web Hosting Talk : Web Hosting Main Forums : Dedicated Server : Linux memory usage
Reply

Dedicated Server Current and past experiences with dedicated server providers, bandwidth, and server performance. Review managed and unmanaged dedicated web servers, discuss both Windows and Unix dedicated server solutions, and discuss dedicated hosting providers. If your service is unavailable, please click here.
Forum Jump

Linux memory usage

Reply Post New Thread In Dedicated Server Subscription
 
Send news tip View All Posts Thread Tools Search this Thread Display Modes
  #1  
Old 05-18-2006, 02:53 PM
TQ Mark TQ Mark is offline
Web Hosting Master
 
Join Date: May 2002
Location: Raleigh, NC
Posts: 605

Linux memory usage


Generally on Linux servers, I see physical memory usage high, which is normal as Linux likes to reserve extra memory.

I'm perplexed, this server is only shows about 50% physical memory usage, yet it is also using over 400MB of swap. Why would it start using swap if all of the physical memory isn't used?

Quote:
top - 14:52:31 up 6 days, 8:08, 2 users, load average: 4.75, 6.25, 4.78
Tasks: 166 total, 3 running, 163 sleeping, 0 stopped, 0 zombie
Cpu(s): 65.3% us, 15.8% sy, 0.0% ni, 14.5% id, 3.6% wa, 0.7% hi, 0.0% si
Mem: 1035800k total, 352276k used, 683524k free, 5212k buffers
Swap: 2048184k total, 445832k used, 1602352k free, 50876k cached

Reply With Quote


Sponsored Links
  #2  
Old 05-18-2006, 10:17 PM
besty besty is offline
Web Hosting Master
 
Join Date: Mar 2006
Posts: 644
Hi,

The physical memory usages depends upon the hardware and os kernel.Some may use 90 % of ram memory (physical memory) and 40 % of swap memory, others may use 50% physical memory and 50% swap memory . Its fully depends upon the hardware configuration

Reply With Quote
  #3  
Old 05-18-2006, 10:24 PM
powersearcher powersearcher is offline
Disabled
 
Join Date: May 2006
Posts: 9
On one of the servers I manage, I have seen the swap be completely used up while the physical memory is fine. It is an interesting anonmaly.

Reply With Quote
Sponsored Links
  #4  
Old 05-18-2006, 11:34 PM
Steven Steven is offline
I like ice cream
 
Join Date: Mar 2003
Location: California USA
Posts: 11,634
On 2.6 kernel there is a sysctl setting:

Quote:
Since 2.6, there has been a way to tune how much Linux favors swapping out to disk compared to shrinking the caches when memory gets full.

When an application needs memory and all the RAM is fully occupied, the kernel has two ways to free some memory at its disposal: it can either reduce the disk cache in the RAM by eliminating the oldest data or it may swap some less used portions (pages) of programs out to the swap partition on disk. It is not easy to predict which method would be more efficient. The kernel makes a choice by roughly guessing the effectiveness of the two methods at a given instant, based on the recent history of activity.

Before the 2.6 kernels, the user had no possible means to influence the calculations and there could happen situations where the kernel often made the wrong choice, leading to thrashing and slow performance. The addition of swappiness in 2.6 changes this. Thanks, ghoti!

Swappiness takes a value between 0 and 100 to change the balance between swapping applications and freeing cache. At 100, the kernel will always prefer to find inactive pages and swap them out; in other cases, whether a swapout occurs depends on how much application memory is in use and how poorly the cache is doing at finding and releasing inactive items.

The default swappiness is 60. A value of 0 gives something close to the old behavior where applications that wanted memory could shrink the cache to a tiny fraction of RAM. For laptops which would prefer to let their disk spin down, a value of 20 or less is recommended.

As a sysctl, the swappiness can be set at runtime with either of the following commands:

sysctl -w vm.swappiness=30
echo 30 >/proc/sys/vm/swappiness

__________________
Steven Ciaburri | Proactive Linux Server Management - Rack911.com | 1.855.RACK911
System Administration Extraordinaire

Managed Dedicated Servers, Linux Server Management, Disaster Recovery, Server Security Audits

Reply With Quote
  #5  
Old 05-19-2006, 09:30 AM
WoodiE55 WoodiE55 is offline
Aspiring Evangelist
 
Join Date: Feb 2002
Location: Indiana
Posts: 367
I too wondered about this, on my machine even after a reboot my memory useage jumps to about 90-95% and usually stays there, however it's never once used swap.




-Michael

__________________
Debt-Made-Easy.com - Get out of debt tips.

Reply With Quote
  #6  
Old 05-19-2006, 02:35 PM
MrZillNet MrZillNet is offline
Web Hosting Guru
 
Join Date: Aug 2005
Location: PA
Posts: 307
It is only a concern if you are actually seeing a slowdown. Could it have been a case where a lot of RAM was used, say by a webstats program, then was freed when the program exited? In such a case, pages that were swapped out, but haven't been needed since, would stay in swap.

__________________
reliable colocation ... Dedicated Servers | Dedicated Server VMs | FAST links to Vitelity.com and Conexiant.net
patrick@zill.net Cell +1.717.201.3366

Reply With Quote
Reply

Related posts from TheWhir.com
Title Type Date Posted
Big Data and Cloud Drive Enterprise Linux Adoption: Report Web Hosting News 2013-03-27 12:54:34
Web Host AYKsolutions Launches Unmetered Linux VPS Hosting at Chicago Data Center Web Hosting News 2013-01-07 16:23:08
Web Host MochaHost Adds New Features to Linux VPS Hosting Plans Web Hosting News 2012-08-01 15:52:14
Web Host InMotion Upgrades VPS with More Memory, Bandwidth Web Hosting News 2012-03-08 14:15:08
Linux Foundation Website Down After Security Breach Last Week Web Hosting News 2011-09-12 20:32:11


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes
Postbit Selector

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Forum Jump
Login:
Log in with your username and password
Username:
Password:



Forgot Password?
Advertisement:
Web Hosting News:



 

X

Welcome to WebHostingTalk.com

Create your username to jump into the discussion!

WebHostingTalk.com is the largest, most influentual web hosting community on the Internet. Join us by filling in the form below.


(4 digit year)

Already a member?