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:
OS: Ubuntu 12.04 (32 bit)
Kernel: 3.13.0-32-generic
RAM: 2GB
CPU: AMD Athlon(tm) 64 Processor 3500+ (2.2 GHz)
MOBO: Asus A8N-SLI DELUXE (BIOS Revision 1011 - June 2005)
Connection Type: Ethernet
Internet Speed: 22Mb/s down
Plex Version: 0.9.9.14.531-7eef8c6
Here's the output of my memory right now while streaming 6 different videos
1 smartphone running PlexApp
1 laptop running Plex Home Theatre
1 desktop running both Plex Home Theatre and the Plex via the Browser
1 XBOX streaming DLNA
Here's my current memory usage:
# free -m
total used free shared buffers cached
Mem: 2015 1880 134 0 161 1359
-/+ buffers/cache: 359 1656
Swap: 6143 0 6143
I have other configuration settings detailed on another Forum post:
https://forums.plex.tv/topic/112703-streaming-stuttering/