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 Apache +Mysql+ PHP installed on 4G memory server which serve around 20000 visits per day. The following graph shows the memory utilization for one day. As you can see from the graph: the free memory is low (e.g 155 M) and the cached memory is high (e.g 2G). This server did not use the swap memory ever.

  • do I need to increase the memory?
  • Is it safe to have low free memory but high cached memory?
  • How do I find which application using a lot of cache memory?

Thanks a lot for help. alt text

share|improve this question
    
    
What supervision application is that ? Looks good ! –  Antoine Benkemoun Feb 16 '10 at 8:19
    
www.serverdensity.com I recommend them –  usef_ksa Feb 16 '10 at 11:50
    
thanks Zordache for the great links –  usef_ksa Feb 16 '10 at 11:57
add comment

3 Answers

up vote 2 down vote accepted

The cached memory is the disk cache used by the VFS. It will store files that are read there so that it does not have to hit the hard drive when they are needed, and if some application need memory, it will release some.

The questions you should ask yourself are :

  • is it getting slow / sluggish
  • is it swapping used applications

If both answers are no, then, you don't need to do anything. Even if some applications get swapped out a bit, it may be because the part that has been swapped is never used and can safely be stored on swap.

The idea is that as long as everything's working fine, don't try to fix it, cached memory, and even swapping out pages is the normal operation of a VM operating system.

share|improve this answer
    
Thanks for help. I got the Idea. thanks also for Zoredach & amo-ej1 –  usef_ksa Feb 16 '10 at 12:00
add comment

Your question was not specific, but I am going to assume the system running apache is Linux-based. Cached memory is memory used by the kernel for caching files. This is generally a good thing, and normal. Having memory in your system that does nothing is silly when it could be doing something useful like speed up access to your files.

share|improve this answer
add comment

As stated above, the cached memory is just an in memory (fast) buffer for the data stored on your hard disks (slow). You will typically see that if the used memory (by your applications) increases, the cached count will decrease. So this looks like a fairly normal graph to me.

Another parameter you should keep into account is the swap usage, as soon as your system is starting to use swap (which is on disk memory and thus slow) it means that your system is running sub-optimal and this suggest the addition of physical memory.

Actually should be happy in this case that your operating system is making such efficient use of your memory (by using it as disk cache), it would be rather pointless to read/write everything to disk (which is slow) while you have ram a la plenty sitting around not being used for anything.

share|improve this answer
add comment

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.