You are not logged in.

#1 2023-03-31 12:34:34

darshan3v
Member
Registered: 2023-03-31
Posts: 3

Tuning Parameters for ZRAM

I have setup ZRAM using zram-generator, and i was exploring a bit more , i searched but i didn't find any proper way on how to determine whats the best way to figure out parameters like swappiness, cache_pressure, etc... that fits my system

i have learnt about these parameters but is their a standard way that runs test and uses different values of these parameter and generate a report out of it , I would be grateful if anybody could guide me on how should i approach this

Offline

#2 2023-04-01 17:08:14

snakeroot
Member
Registered: 2012-10-06
Posts: 177

Offline

#3 2023-04-01 17:52:39

darshan3v
Member
Registered: 2023-03-31
Posts: 3

Re: Tuning Parameters for ZRAM

i have gone through that blog , he provides good explanation but he tells value of swappiness , cache_pressure that works for him , what i m looking for is a systemic method , something like in machine learning where we try multiple values of hyper parameters and then compare results, similarly how about making a test and running it with multiple values of these to pick the best one. I would like to know if anybody had done this for a reference to build my own test and check how these parameters affect the result

Offline

#4 2023-04-01 18:41:19

seth
Member
From: Won't reply 2 private help req
Registered: 2012-09-03
Posts: 76,350

Re: Tuning Parameters for ZRAM

1st off all, zram has nothing to do w/ swappiness and cache pressure and 2nd the only way to know what works for *YOUR* usage patterns is to test different values against *YOUR* usage.
What do you think a synthetic test could help you when it applies completely different access patterns?

Also

the blog wrote:

swappiness – represents the kernel’s preference (or avoidance) of swap space. Swappiness can have a value between 0 and 100; the default value is 60. A low value causes the kernel to avoid swapping. A higher value causes the kernel to try to use swap space.

That's bullshit. Or imprecise and possibly misleading at least.
Please read the actual arch wiki segment that's even linked…
https://wiki.archlinux.org/title/Swap#Swappiness

Understanding what these values do will help you to adjust the system, but you also need to know how the system is tasked.
If you often re-read the same files and produce a lot of throw away anon-pages (memory that is not file-based and that you rarely access but that cannot be/is not discarded by the process) you want to increase the swappiness.
Conversely, if you read a lot of files pretty much only once but have a lot of active anon pages, you might want to decrease swappiness.

You can inspect the stats in /proc/meminfo (in/active file and anon pages are probably the most interesting ones) and are maybe looking for programs to gather this statistics for you.
nmon and collectd are popular, but idk whether they allow this fine grained analysis. There're also countless scripts on the internet to track meminfo.

If you have no idea what I just wrote or what that even relates to: leave the configuration alone.
The defaults will probably just work fine.

Offline

Board footer

Powered by FluxBB