0

I recently had to move my internal web servers to a new server. New server runs on Centos 7. My Apache httpd remains the same , also the same with php. Server version:

Apache/2.4.6 (Unix)
PHP 5.4.16

Web servers run fine ( they are Wordpress and dokuwiki) , except httpd consumes more and more memory over the last few days.

             total       used       free     shared    buffers     cached
Mem:          5663       5508        154         43         99        435
-/+ buffers/cache:       4973        689
Swap:         6143        158       5985

Also I've also increased the swapiness from 30 to 60 but that hardly made any improvements. Sorting through, it is the httpd that takes up the biggest chunks of memory.Appreciate any suggestions. Thanks in advance.

c4f4t0r
  • 5,149
  • 3
  • 28
  • 41
kc123
  • 3
  • 1
  • 3
  • I see nothing here indicating that Apache httpd is using up a lot (or any) RAM at all. I see nearly 5 GB of RAM being used for I/O buffering. This is expected and this is a good thing. This question / answer may help you understand better: [Meaning of the buffers/cache line in the output of free](http://serverfault.com/questions/85470/meaning-of-the-buffers-cache-line-in-the-output-of-free/85481#85481) –  Feb 02 '15 at 19:41
  • Thanks yoonix. But 3 days ago there were 700M free Mem and 1890 free buffer cache. Now I have only 154M free Mem and 689 free buffer cache. Memory consumption is steadily increasing over those time. Is this some kind of memory leak and how do I pinpoint what's the cause ? – kc123 Feb 02 '15 at 20:00
  • The cause is 'working as expected'. Linux takes your free memory and uses it to buffer i/o until that memory is needed elsewhere. 'Free' ram is wasted resources. Linux puts those resources to work. You have no problem here. This site should explain it a little better. [Help! Linux ate my RAM!](http://www.linuxatemyram.com/) In short: You have no problem, you have a misunderstanding on how Linux uses RAM. –  Feb 02 '15 at 20:12
  • @yoonix Not sure I would completely classify it as 'working as expected' since kc has seen a drop in free ram after cache/buffers of 1200 MB which over 3 days isn't necessarily an emergency but points to the potential of a leak. kc, do you notice anything unusual in your logs or in the behavior/responsiveness of your site? If you let it run another day does the free after cache/buffers further decrease to lower than 689? – Foosh Feb 02 '15 at 20:32
  • 1
    @Foosh It's possible. You can easily tell whether I'm right or not by running `free -m;sync;echo 3 > /proc/sys/vm/drop_caches;free -m` and check free again. The 'used' column under buffers/cache is not just userland. Dirty pages that need to be flushed to disk (like buffering disk writes) will not show up under free unless / until they're flushed. I see this regularly on systems of mine with heavy NFS usage (lots of small files, thousands of directories). @kc123 Can you also run `top -ab` and add that output? It'll run top once, sorting by allocated memory. –  Feb 02 '15 at 21:24

0 Answers0