Hi, A few days ago I checked the health of my main public server running CentOS 7, a quad-core machine with 16 GB RAM. It had been running non-stop for 65 days, hosting only a handful of services (BIND, NTP, Apache, Postfix, Dovecot) for two domains. I was surprised to see that RAM consumption was relatively high, and apparently, the machine even had to swap at some time. I read up a bit on RAM consumption, and now I wonder if flushing the memory cache regularly is a good idea. https://tecadmin.net/flush-memory-cache-on-linux-server/ Any suggestions? Niki -- Microlinux - Solutions informatiques durables 7, place de l'?glise - 30730 Montpezat Web : http://www.microlinux.fr Mail : info at microlinux.fr T?l. : 04 66 63 10 32
On 09/09/17 12:43, Nicolas Kovacs wrote:> Hi, > > A few days ago I checked the health of my main public server running > CentOS 7, a quad-core machine with 16 GB RAM. It had been running > non-stop for 65 days, hosting only a handful of services (BIND, NTP, > Apache, Postfix, Dovecot) for two domains. > > I was surprised to see that RAM consumption was relatively high, and > apparently, the machine even had to swap at some time. >Why were you surprised? Linux systems use the available RAM, surely you understand that? Of course there is the possibility that you have discovered a bug and there is a memory leak on your system, building up over time. I suggest you show the list full memory usage details if you feel this is the case.> I read up a bit on RAM consumption, and now I wonder if flushing the > memory cache regularly is a good idea. > > https://tecadmin.net/flush-memory-cache-on-linux-server/ > > Any suggestions? >Did you read the kernel documentation on the subject linked in comments section of that article?> Niki >
Le 09/09/2017 ? 14:41, Phil Perry a ?crit :> Why were you surprised? Linux systems use the available RAM, surely you > understand that?I'm surprised because my system used the available RAM and then it even began to swap.> > Of course there is the possibility that you have discovered a bugMinimal CentOS 7 installation with BIND, Apache, MySQL, Postfix and Dovecot, regularly updated. Hence my post. Wondering if other CentOS users experienced something similar. Niki Kovacs -- Microlinux - Solutions informatiques durables 7, place de l'?glise - 30730 Montpezat Web : http://www.microlinux.fr Mail : info at microlinux.fr T?l. : 04 66 63 10 32
On 09/09/2017 04:43 AM, Nicolas Kovacs wrote:> I read up a bit on RAM consumption, and now I wonder if flushing the > memory cache regularly is a good idea.Typically, no.? Whatever pages of memory the system has swapped out are pages that the kernel's counters indicate are less often used than the pages that are in RAM. The presence of pages in swap isn't necessarily bad.? If, on the other hand, you were seeing pages actively swapped in and out of swap, that might indicate that the system needs more RAM than it has. You can tune how conservative the system is about swapping memory in exchange for file cache by setting the "vm.swappiness" system parameter.