Quantcast
Channel: Recent Discussions — Plex Forums
Viewing all articles
Browse latest Browse all 151235

Heavy memory usage/system load on Linux, a solution and a question

$
0
0

Hi,

I was having trouble with Plex media scans gobbling all the memory and gobbling all the swap on my linux system. Searching around I found this suggested solution in another thread.

"Has no one thought about limiting swap and only using it as a last resort to save the machine if it ever ran fully out of RAM?
By default, Linux uses a default swappiness of 60. To check your current swappiness level, run the following command:

cat /proc/sys/vm/swappiness

Swap is a carved out disk space configured to be used as virtually memory which holds pages that are currently inactive. Naturally, disk reads are going to be slower than RAM so if you're using a swappiness level of 60, you're highly likely to start paging into Swap a lot sooner than if you have that swappiness value tuned lower.
Of course, tuning many settings in Linux is variable depending on the applications which you run and it would be in your best interest to play with things.
If I wanted to configure my server with a Swappiness value of 1, I would do the following to set it now and make it persistent upon reboots:

sudo sysctl vm.swappiness=1

echo "vm.swappiness = 1" >> /etc/sysctl.conf

I've done some tweaking on the kernel level system variables and such but my server can play just about anything I throw at it and have been able to have three local machines playing video while two other cell phone apps were viewing remotely. I have a very old, low end PC running Ubuntu Server:"

It is working gang busters for me at this point, the system load is tiny and (i'm guessing) Plex is being memory starved a bit by not being allowed to spawn to many new threads when doing the memory scan. I assume this will slow the overall scan down but it also means my machine isn't choked by using all its swap.

Assuming there isn't some serious problem I am unaware of with this solution (I understand the basics of swap and how it works) could this be added to the FAQ's for problem solving? It works so well and i've been looking for a solution for a while and got lucky with a google search. I'd be happy to write it up if that is the limiting factor here.

I don't know what would be a similar solution for Win/MacOS/FreeBSD systems but at least for the last two there is probably something similar that would work if the problem is similar.


Viewing all articles
Browse latest Browse all 151235

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>