메뉴 건너뛰기

신축건물 하자 보수 센터

Fehnocache Minimize Caching Effects GitHub

WalkerFortier222 2026.07.14 14:18 조회 수 : 0

免费俄罗斯色情 - https://mrq.com/.

Fehnocache minimize caching effects GitHub


What is this tool good for:


What this tool is not good for:


So then why does this tool exist?


How to run a process and its children in a memory-bounded cgroup


Do this if you e.g. want to run a backup but don’t want your system to slow
down due to page cache thrashing.


If your distro uses systemd, this is very easy. Systemd allows to run a
process (and its subprocesses) in a "scope", which is a cgroup, and you can
specify parameters that get translated to cgroup limits.


When I run my backups, I do:


The effect is that cache space stays bounded by an additional max 500MiB:


Before:


During (notice how buff/cache only goes up by ~300MiB):


Use systemd-cgls to list the cgroups systemd creates. On my system, the above
command creates a group called run-u467.scope in the system.slice parent
group; you can inspect its memory settings like this:


Install cgroup-tools and be prepared to enter your root password to initially
create cgroups.


After entering this, your shell is a member of that cgroup, and any new process
spawned will belong to that cgroup, too, and inherit the memory limit. The
cgroups created like this won’t be cleaned up automatically.


More info: https://www.kernel.org/doc/Documentation/cgroup-v1/memory.txt


The nocache tool tries to minimize the effect an application has on
the Linux file system cache. This is done by intercepting the open
and close system calls and calling posix_fadvise with the
POSIX_FADV_DONTNEED parameter. Because the library remembers which
pages (ie., 4K-blocks of the file) were already in file system cache
when the file was opened, these will not be marked as "don't need",
because other applications might need that, although they are not
actively used (think: hot standby).


Just type make. Then, prepend ./nocache to your command:


The command make install will install the shared library, man
pages and the nocache, cachestats and cachedel commands
under /usr/local. You can specify an alternate prefix by using
make install PREFIX=/usr.


Debian packages are available, see https://packages.qa.debian.org/n/nocache.html.


Please note that nocache will only build on a system that has
support for the posix_fadvise syscall and exposes it, too. This
should be the case on most modern Unices, but kfreebsd notably has no
support for this as of now.


For testing purposes, I included two small tools:


It looks like this:


Also, you can use vmstat 1 to view cache statistics.


For debugging purposes, you can specify a filename that nocache should log
debugging messages to via the -D command line switch, e.g. use nocache -D /tmp/nocache.log …. Note that for simple testing the file /dev/stderr
might be a good choice.


Without nocache, the file will be fully cached when you copy it
somewhere:


With nocache, the original caching state will be preserved.


The pre-loaded library tries really hard to catch all system calls
that open or close a file. This happens by "hijacking" the libc
functions that wrap the actual system calls. In some cases, this may
fail, for example because the application does some clever wrapping.
(That is the reason why __openat_2 is defined: GNU tar uses this
instead of a regular openat.)


However, since the actual fadvise calls are performed right before
the file descriptor is closed, this may not happen if they are left
open when the application exits, although the destructor tries to do
that.


There are timing issues to consider, as well. If you consider nocache cat , in most (all?) cases the cache will not be restored. For
discussion and possible solutions see http://lwn.net/Articles/480930/.
My experience showed that in many cases you could "fix" this by doing
the posix_fadvise call twice. For both tools nocache and
cachedel you can specify the number using -n, like so:


This actually only sets the environment variable NOCACHE_NR_FADVISE
to the specified value, and the shared library reads out this value.
If test number 3 in t/basic.t fails, then try increasing this number
until it works, e.g.:

莫斯科旅行全攻略,身体与精神双重享受,一般人我不告诉他

One could also consider that the fact pages are kept mean the kernel
considers they are hot, and decide the overhead of allocating one byte
per page for mincore and the actual mincore calls are not worth it when
the kernel actually does keep some pages when it wants to.


In this case you can either run nocache with -f or set the
NOCACHE_FLUSHALL environment variable to 1, e.g.:


By default nocache will only keep track of file descriptors less than 2^20
that are opened by your application, in order to bound its memory
consumption. If you want to change this threshold, you can supply the
environment variable NOCACHE_MAX_FDS and set it to a higher (or lower) value.
It should specify a value one greater than the maximum file descriptor that
will be handled by nocache.


Most of the application logic is from Tobias Oetiker's patch for
rsync http://insights.oetiker.ch/linux/fadvise.html. Note however,
that rsync uses sockets, so if you try a nocache rsync, only
the local process will be intercepted.

번호 제목 글쓴이 날짜 조회 수
32892 Marika 变回金发女郎 28 赫格雷 工作室摄影 ChanaIgo7484921451 2026.07.14 0
32891 The Top 20 Pornstars From Ukraine KermitFielding9 2026.07.14 0
32890 The Top Mobile Slot Bonus Codes For Thai Gamblers ArnetteCoffelt8 2026.07.14 0
32889 Comprehensive Guide To PayPal Login And Sign In RosalindaF07124 2026.07.14 1
32888 午夜探花哥星級酒店開房現場直播高價約了個俄羅斯大洋妞啪啪 主動舔雞巴口交乳交猛烈抽插幹得直叫求饒 太猛了 國語對白 JeffryWatt81379392441 2026.07.14 0
32887 Answers About Ford Escape LenardBlankenship 2026.07.14 0
32886 经济干型透析袋 瑞达恒辉 DeniceMetcalf160 2026.07.14 0
» Fehnocache Minimize Caching Effects GitHub WalkerFortier222 2026.07.14 0
32884 Contrasting RV Finance Prices: Discovering The Very Best Bargain For Your Journey HaleyCho790490305215 2026.07.14 0
32883 Sport Aktuelle Nachrichten und Hintergründe ArthurCurrier287 2026.07.14 0
32882 Why Thai Mobile Slot Apps Are Breaking Records In 2025 MohammadKeysor02834 2026.07.14 0
32881 Jual Paket Pasang CCTV Di Semarang GlenHausmann4448 2026.07.14 0
32880 8 Ways To Maintain Your MassageTalks Growing Without Burning The Midnight Oil Karissa8985306316057 2026.07.14 0
32879 Paket CCTV Di Ambarawa: Solusi Keamanan Terbaik Di ClickCCTVsmg.com AndrewBarff88822458 2026.07.14 0
32878 Master The Art Of Winning On Thai Mobile Slot Machines DarciJersey808573 2026.07.14 0
32877 Spin And Win: Thai Mobile Slot Tips You Need Now JonnieCobby7316923 2026.07.14 0
32876 Trouver une cougar près de chez soi avec JM Cougar TerriWilkerson200811 2026.07.14 0
32875 How To Claim Free Cash On Thai Mobile Slot Platforms RoxanneE7066439609 2026.07.14 0
32874 The Biggest Mobile Slot Wins Ever Recorded In Thailand Jess67543108402 2026.07.14 0
32873 JM Cougar, site spécialisé dans les rencontres cougar LeonidaFocken188423 2026.07.14 0
위로