High page cache usage

  • Over time the memory Page Cache usage maxes out and doesn't come down until after a reboot. My server is a dual core AMD proc with initially 2GB of RAM. I was consistently getting seeing this happen and there would be poor performance until the server would lockup, giving a kernel out of memory error at the console. I searched around and saw that maybe I needed more RAM, so I purchased 8GB and put that in there. I'm still seeing the issue and poor performance on my media servers within a week's worth of usage. I don't think it's completely locked up with the kernel error since the RAM increase though. At this point I'm maxed out on the memory I can put in the box. Any suggestions?



    Uploaded with ImageShack.us

  • I just upgraded to 0.4.0.2 and am still having the same issue. No lockups recently, but then again I do update and reboot often to clear the page cache. Is there a command I could put in a cron job to clear the page cache?


    On another note, my install is on an external USB 2.0 drive which I've seen in another thread as being problematic. I wonder if this is just a symptom of the external drive issue...

  • I found a possible solution via http://www.hosting.com/support…ory-cache-on-linux-server, and so far it's working. If I notice any issues I will post back. Here's what I did:


    - ssh into OMV
    - Create a file in '/root' called 'clearcache.sh' with the following content:

    Bash
    #!/bin/sh 
    sync; echo 3 > /proc/sys/vm/drop_caches


    - make it executable (chmod -x /root/clearcache.sh)
    - create a cron job to run /root/clearcache.sh every hour (as root)
    - check free memory before, run cron job to test, check free memory after



    Here's a screenshot for reference. I will post back another screenshot after a week for comparison.



    Uploaded with ImageShack.us

    • Offizieller Beitrag

    I don't have that problem on any of my OMV systems. Are you running a plugin that may be causing the problem? Do you have OMV installed on a USB flash drive?

    omv 7.0.4-2 sandworm | 64 bit | 6.5 proxmox kernel

    plugins :: omvextrasorg 7.0 | kvm 7.0.10 | compose 7.1.2 | k8s 7.0-6 | cputemp 7.0 | mergerfs 7.0.3


    omv-extras.org plugins source code and issue tracker - github


    Please try ctrl-shift-R and read this before posting a question.

    Please put your OMV system details in your signature.
    Please don't PM for support... Too many PMs!

  • The hunt for free memory and frequent reboots is a mental state induced by many years on Windows systems with leaky memory management ;) Linux has a different approach to memory management: rather than trying to always have a lot of free memory available and doing nothing, linux is using as much of it as possible. The reason for this is that, once some data has been accessed, chances are it may be needed again; why empty the memory then re-read it from the slow drives again, when you have gigabytes of RAM sitting around? Whenever the need for more memory comes, its built-in mechanisms for memory management will kick in and set some of this cache memory free. This makes perfect sense from a performance point of view. In linux world, it's quite common to have all RAM in use.

  • Need to agree puterfixer:


    You should read about page cache and what it is.


    So what is the page cache? It is in general the disk cache (beneath other things) where before writing to disk it will be cached in memory. After writing to memory it will then be written to disk by the flush process. You can find the flush processes with ps -eaf


    Code
    root@openmediavault:~# ps -eaf | grep -i flush
    root       935     2  0 10:36 ?        00:00:00 [flush-8:0]
    root       936     2  0 10:36 ?        00:00:00 [flush-8:16]


    So for each device/md you will get a flush process.


    The page cache uses the maximum amount of available free ram, and fills up by writes and reads to speed up the write and read process. The kernel will automatically release page cache if other processes request additional memory. So it is absolutely normal that all free RAM is allocated to page cache if someone uses the system (reads/writes from it).


    So the page cache is extremely usefull especially on a file server (which as NAS box is in the end).


    You should not get any memory allocation errors caused by the page cache using all available RAM.

    Everything is possible, sometimes it requires Google to find out how.

  • Ok, this leads me to a question, (I'm a OMV noob, so so forgive me if I missed this), when do you know if your system performace is suffering due to not having enought memory in your OMV?

    OMV 4.1.0-1 Arrakis running on:
    IBM System x3400 server
    Dual Xeon 5110 1.6Ghz CPUs
    4Gb RAM
    40Gb IDE System drive
    8-2Tb Data HDDs

    • Offizieller Beitrag
    Zitat von "IamTed"

    Ok, this leads me to a question, (I'm a OMV noob, so so forgive me if I missed this), when do you know if your system performace is suffering due to not having enought memory in your OMV?


    When you aren't happy with the performance :) If you just use it as a file server, two gigs is more than enough for me.

    omv 7.0.4-2 sandworm | 64 bit | 6.5 proxmox kernel

    plugins :: omvextrasorg 7.0 | kvm 7.0.10 | compose 7.1.2 | k8s 7.0-6 | cputemp 7.0 | mergerfs 7.0.3


    omv-extras.org plugins source code and issue tracker - github


    Please try ctrl-shift-R and read this before posting a question.

    Please put your OMV system details in your signature.
    Please don't PM for support... Too many PMs!

  • Thanks Ryan. I agree with always wanting more in the performance department. :o) As for this machine, it only has a gig of ram. It is replacing the serving duties of my WHS box. After the media library on it growing to about 1000 movies and about 150 TV Series, serving out to five old Xboxes that are running XBMC on them, the WHS started to get a little too slow, to the point that it was falling below the WAF and I was getting complaints. (WAF= Wife Acceptance Factor)
    Hopefully running the OMV for the video content will improve things.

    OMV 4.1.0-1 Arrakis running on:
    IBM System x3400 server
    Dual Xeon 5110 1.6Ghz CPUs
    4Gb RAM
    40Gb IDE System drive
    8-2Tb Data HDDs

  • Zitat von "IamTed"

    Ok, this leads me to a question, (I'm a OMV noob, so so forgive me if I missed this), when do you know if your system performace is suffering due to not having enought memory in your OMV?


    The answer is not that easy.


    First of all the RAM will be used for data and for buffers. So if the available RAM gets low, Linux will sacrifice Buffers as trade for data. That will ensure, that the applications do not run out of memory (as long as you have memory).


    On the other hand, RAM used as buffers is definately good for the performance of a file server. But anyhow, give the OMV 2Gig of RAM will be enough for a decent file server. If you have more, okay great, but the performance benefits will be minor as long as you are not using it in an 100 User environment.


    But something is not very useful:
    Forcing the kernel to release all buffer caches, so that the memory is nice and green and empty ... :?

    Everything is possible, sometimes it requires Google to find out how.

  • Zitat von "SerErris"

    But something is not very useful:
    Forcing the kernel to release all buffer caches, so that the memory is nice and green and empty ... :?


    (first post here)
    i use omv just as a "data grave" where i put up stuff from time to time, therefore quick answer times are not as important as in a business server environment. i recognize higher power consumption of my nas (former desktop pc with 5 old hdds in raid5, 2gb ram) after i moved some data to omv, compared to the "empty" state of the ram just after booting - also after spindown. is there a way to carefully clean up the ram after a certain time?
    cheers.

  • I see it as; it is just how OMV works. I've also watched the load and cpu graphs, and they change as needed along with the memory. Also it may not be OMV doing this but the Linux version upon which OMV is built. So OMV works and works fine - for me using Samba and miniDLNA.


    For those concerned about power usage, and the money spent on it, maybe the answer is WOL (Wake On LAN). This would/should save some. Do a search for WOL here in the forums.


    You could also set up times for Shut Down & Reboot from Power Management for when you work, sleep, or are away. This would also have the benefit of flushing the cache and the memory would be free till OMV was being used.


    Though if you are using miniDLNA, upon reboot it rebuilds it's database and the result is the page cache use goes back up.


    Again, it works, and works fine! So it is a non-issue for me.

  • Let me say in other words.


    It is nothing to worry about and it is not OMV at all. This is the linux kernel itself, that handles the disk caching. It is simply using all memory for disk caching as default and that is a good idea. It will not slow down anything and also it will not use more power. The RAM needs refreshing every some microseconds and that for the whole RAM. It does not matter if the Cells of the RAM contain all ZERO or any other byte values.


    So therefore ... do not worry about it at all, as long as you have buffers. If your RAM is full and you have no Buffers ... then you are in trouble, cause your applications require more RAM than you have built in. It is unlikely to happen for most usecases

    Everything is possible, sometimes it requires Google to find out how.

Jetzt mitmachen!

Sie haben noch kein Benutzerkonto auf unserer Seite? Registrieren Sie sich kostenlos und nehmen Sie an unserer Community teil!