LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Debian
User Name
Password
Debian This forum is for the discussion of Debian Linux.

Notices


Reply
  Search this Thread
Old 01-29-2022, 08:04 AM   #1
bodqhrohro
Member
 
Registered: Apr 2018
Location: Ukraine
Distribution: Debian GNU/Linux 12
Posts: 62

Rep: Reputation: Disabled
Is it possible to limit the read cache per process/cgroup?


Let's say, I run diff -rq on two big directories. All their contents appears in the read cache, and inevitably washes anything else from the read cache. So, even if there is still a lot of free RAM, other processes that depend on I/O eventually start suffering from 12309-like symptoms.

Setting ionice -c 3 on the diff process wouldn't help. It's possible to lock required files in RAM, so they won't be washed off at all, but this is an opposite approach and requires lots of opt-in fine-tuning for real cases, instead of opt-out.

I'd like instead just to limit only such kind of processes intended to fulfill background tasks involving scanning the whole disk during other work. If not per process, can I at least put them in a cgroup, where the page cache usage is limited, so it wouldn't take up all of the free memory? Or, as a last resort, can read caching be switched off for a process completely (it doesn't make sense anyway, as everything is read sequentially and used only once)?
 
Old 01-29-2022, 11:56 PM   #2
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 21,130

Rep: Reputation: 4121Reputation: 4121Reputation: 4121Reputation: 4121Reputation: 4121Reputation: 4121Reputation: 4121Reputation: 4121Reputation: 4121Reputation: 4121Reputation: 4121
Try it and see. With cgroup2 the memory management is more refined - if you set memorymax that will include any frames being assigned to pagecache. Might mess with the diff, but should shield other processes in other cgroups.
 
1 members found this post helpful.
  


Reply

Tags
cache, cgroups, freeze, limit



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Set scheduling method per thread, not per process? somanyquestions Linux - Software 2 01-21-2019 03:15 AM
iptables limit per IP per minute - "No chain/target/match by that name" no_root_no_cry Linux - Networking 3 12-25-2013 03:06 PM
In PPTP server, how to limit bandwidth per user, & no. of connection per account ? erv2 Linux - Networking 1 04-05-2010 08:03 AM
SQUID - connection limit per user not per IP adress iksik Linux - Software 3 03-10-2010 09:52 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Debian

All times are GMT -5. The time now is 07:00 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration