easimon / maximize-build-space

Github action to maximize the available disk space on Github runners
MIT License
367 stars 74 forks source link

[Suggestion] Use zram as main swap while swap ram as backup #43

Open Lu5ck opened 5 months ago

Lu5ck commented 5 months ago

Some compilations need a lot of rams and sometimes, the runner will timeout and it isn't because of lack of ram as you can assign gigs of swap ram, it timeout because the swap ram is taking forever, I believe due to everybody fighting over IO on these drive, it is public runner afterall.

I did a fork and replaced the swap ram code with zramctl. My compilation which usually timeout and if it did not timeout, it usually compile in 45 minutes. With zram, it didn't timeout and compiled in 30 minutes, huge improvement.

With that said, I suggest (an elegant) implementation of zram as primary swap while using swap ram as backup swap. On a side note, the zram device takes a second to create on these public runner.

RadxaYuntian commented 3 months ago

Here is how to set swap priority.