First of all: happy holidays
I have an issue for the past month or so, transmission or airsonic is regurally killed by DietPi.
When searching the logs, I found out that it’s because the system is out of memory.
This leads me to this question:
what can I do?
- to understand why it is running low?
- to find a workaround?
I’m using an Odroid C2, with last version of Dietpi, and using proftpd, mariadb, php7.4, apache2, transmission, airsonic, medusa, jackett, syncthing, webmin, fail2ban, rsyslog.
I guess you would need to find out how your memory is utilized on your system. Probably you can use “free -m” or “htop” to check how it looks like. Maybe you are running short in phys mem.
Here’s htop command result:
Both medusa and airsonic are at 25%+
Physical mem is at 1,17 of 1,6G, Swamp at 209 of 321M…
That’s a lot, right?
yep your mem is nearly gone. So indeed your are running out of phys mem and swap. Swap file could be increased but might not be the best option (reduction in performance and increase of I/O). First you could restart your entire system (SBC) to clean all the allocated mem. if after a restart you still use all of your mem, you should rethink to get a device with more phys mem (like 4GB RPi4) or to reduce number of applications running. Usually medusa or airsonic as they use the most. 3rd option would be to have a 2nd device. That would allow to split the load
I reduced the size of medusa db, and rebooted the sbc. Memory is back, but well, I know it’s gonna go again.
I can see in htop that airsonic is launched with the -Xmx345m option, which allocate only 345M of memory. Why is it using +400M then?
I’ll maybe add a cron job to reboot every night or something if I cannot find another way.
well not sure if the additional 50M of airsonic will save your life. But maybe something you would need to check with the developer of airsonic why its using more than configure. Could be some more memory areas are loaded, not only heap
Indeed rebooting every night might help. Even a proofed concept in real IT hosting as well to avoid memory leaks and system running out of mem You could use DietPi cron function to have such a rebooting script setup
But if you still have such memory needs on your system, it might be better to increase hardware - get a new device
I’ll consider it…
Raspberry pi 4 or Rock64
Personally I’m using a RPi4 4GB. Usually RPi should have a larger community/support. But I guess it depends on your own preferences at the end.
Does the kernel support zram?
Worse comes to worse…create a swap file and expand your existing swap (but it will wear out your SD card ALOT quicker)
Remember SBC’s are about 1/4 capable computers…they are not massive powerhouses…heck even a cheap old anemic laptop with dual or quad core is more capable than most SBC’s
They are good for only one or two large applications for dedication…too many and it bogs it down hardcore
Do you have a NAS that is capable of NFS, then create a swap file there…this way it doesn’t use the SD card but still expands the swap size
tmpfs nfs swapfile - use one computer’s RAM as SWAP for another computer