-
Notifications
You must be signed in to change notification settings - Fork 225
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Disable memory swapping on Linux servers #3381
Conversation
Thanks. But why would the OS swap in the first place? The app is active and ram should be available for such a small footprint. Maybe the server is running too much other stuff? |
Yeah, the server runs other stuff too (such as a system that broadcasts MP3 streams, some web servers), so that’s a possible cause. I did The system I was running happens to have It may be worth noting that many cloud servers use a network-attached disk, so read/writes to disk becomes network I/O. |
I've added this change to my own servers, but I can't actually test properly until I'm back home after my holiday. |
Added to my servers and directories. I've a few other bits:
No idea if the differences help. |
@softins do you think this is ok? |
I added it to my server on AWS some time ago. It didn't make anything worse, but it was hard to tell if it made any improvement. I've since moved my server to Vultr, and forgot to transfer that setting. I've just added it back and restarted the jamulus services, so we'll see. I've just discovered that I'm on Debian 12, which has systemd 252. I've read that this setting is only available in systemd 239 and newer, but I don't know what versions older distros use. I've no objection to merging this. |
Ok. Let's merge this. I don't think there are any disadvantages unless it's run on low RAM machines. |
Short description of changes
Updated systemd unit file to disable swap on Jamulus process.
CHANGELOG: Server: Disabled swap memory usage on Linux.
Context: Fixes an issue?
I noticed that Jamulus server randomly (intermittently) become unresponsive for 0.3 – 1 seconds every once in a while. (This issue has happened for a long time prior.) This caused everyone to experience some sound drops (we call it "ตกหลุมอากาศ," an aviation term that refers to the experience of a cruising plane hitting an air pocket causing turbulence).
Last month I installed Netdata on my servers to collect detailed metrics. It seems that Linux has been paging some memory to/from disk every once in a while around the unresponsiveness occurs.
So systemd has the ability to prevent an app from using swap space. This might help with this issue. From my preliminary testing, it seems to have helped, albeit not completely.
As memory footprint of Jamulus server is very minimal (19.7M used after 8 months of uptime) I think this config change should not have any negative impact unless the server is run on a potato.
Does this change need documentation? What needs to be documented and how?
No.
Status of this Pull Request
Ready
What is missing until this pull request can be merged?
N/A
Checklist