Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I have two VPS servers but they have drastically different amounts of memory usage and processes running. I'm still new to running linux servers so I'm having trouble figuring out what is going on and what I can do to fix it.

Both are Debian 5 32bit installs.

On one server with 128MB of ram and a single CPU core I have a full server running in only 84MB of RAM. The other server has 512MB (quad core CPU) and it has nothing running but core processes yet its still using 94MB of RAM.

Does one have a different kind of virtualization technology that requires more linux core processes or what?

share|improve this question
1  
How are you figuring out how much memory is in use? Are you taking into account cache/buffers? –  Zoredache Jan 4 '11 at 23:20
    
One of those servers appears to have mysql, php, and nginx running and the other doesn't. Post the output of running free as well. –  Mark Wagner Jan 4 '11 at 23:23
    
BTW this list seems incomplete. None of the core processes are listed. –  Zoredache Jan 4 '11 at 23:25
    
@Zoredache the list does seem incomplete compared to the other one. I updated the links with the output of free. Both lists are output from users in sudo su. –  Xeoncross Jan 4 '11 at 23:37
    
Not sure about the process list, but the 512MB system is currently only using ~21MB of RAM according to free. Read the link in my first comment. –  Zoredache Jan 5 '11 at 1:57

1 Answer 1

up vote 2 down vote accepted

You are seeing normal behavior. Don't confuse used memory with unavailable memory. Many structures held in memory can be quickly downsized when memory is required. Expect your usage to increase as long as the system is up and lots of memory is available.

Space used for disk cache counts as used. Once you read or write a file, the data tends to be cached until this space is needed. Log files tend to be write only, but get cached as they are generated. A few things that are noticeable from my usage graph:

  • The longer a system is up the more memory is dedicated to file cache and buffers. This is limited by the amount of memory available. As memory requirements increase, memory dedicated to file cache and buffers may decrease as required.
  • Total memory used stabilizes some Mb short of 100%. This is memory reserved for running sub processes. If this space gets too small expect slow performance and crashes.
  • Total memory used is not nearly import as what it being used for.

If you have any tmpfs file systems, it will use available memory. As memory use goes up, some of this data may be paged into the swap file.

Web server processes often run with a master process to accept incoming connections, and many child processes to handle the requests. The child processes typically have the same PPID (parent process id). One of your servers appears to be running nginx and php-cgi to handle web requests, using a significant number of processes. The command pstree, if available, is useful to see this kind of setup.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.