R
R
Rang2016-10-23 22:25:34
Apache HTTP Server
Rang, 2016-10-23 22:25:34

How to remove /var/log/httpd/*.gz from the system cache (RAM)?

CentOS 7 x64 system.
The httpd service is running, logs are ~500Mb each, there is a daily rotation with archiving, the last 3 months of logs are stored.
So, the system clogs up most of the RAM by caching (leaving) these files in memory.
In htop, you can see how 15% of the RAM is occupied, and about 80% of the cache (orange bar).
When deleting log archives, the cache naturally decreases.
Can I somehow prevent the system from caching log archives in RAM?
There are almost no calls to these logs, I look through them with my hands once a month, and the cache hangs.
Once I even noticed that part of the RAM went into swap, although the actual data still occupied ~ 15-25% of the RAM.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
M
MustDie95, 2017-04-07
@MustDie95

https://www.kernel.org/doc/Documentation/sysctl/vm.txt - look at vfs_cache_pressure and swappines options

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question