Page 1 of 1

How to configure and optimize Serviio

PostPosted: Sun Nov 22, 2020 4:05 pm
by mib182
Hello,

I'm using Serviio V2.1 on virtual server (VmWare esxI on Hp Proliant DL 380 server).
Serviio is installed on Debian 10 (buster).
oracle-java8-installer : 1.8.0_201-b09
ffmpeg 3.2.4

The Vm has 2G of memory and 2G of swap (not often used), And 4vCpu (ntel(R) Xeon(R) CPU E5420 @ 2.50GHz).
My library is on a NAS (4 disks raid5) over a SMB shared, the network allow me to read/write almost 1Gb/s

Here is the launch options :
  Code:
 java -Xmx512M -Xms20M -XX:+UseG1GC -XX:GCTimeRatio=1 -XX:MinHeapFreeRatio=10 -XX:MaxHeapFreeRatio=20 -Djava.net.preferIPv4Stack=true -Djava.awt.headless=true -Dorg.restlet.engine.loggerFacadeClass=org.restlet.ext.slf4j.Slf4jLoggerFacade -Dderby.system.home=/etc/serviio/library -Dserviio.home=/etc/serviio -Dffmpeg.location=ffmpeg -Ddcraw.location=dcraw -classpath /etc/serviio/lib/*:/etc/serviio/config org.serviio.MediaServer


When I use Serviio for stream normal videos (from 300Mb to 4G), all is ok.
But when I Try to used a more bigger video there are freezes, and lag, so bugs.

I think we can configure java options and more others things.
Here is the question : how optimize Serviio? and where do it ?

I don't see load or memory consumption. There is no error in logs.
Does someone has an idea ?

Thanks.

Re: How to configure and optimize Serviio

PostPosted: Tue Nov 24, 2020 6:26 pm
by cmakula
You can use the top command to monitor running processes. The serviio instance will show as java, but you should see it pop up and down as it uses the poller to check files, as well as when transcoding requires CPU time. Hitting Ctrl+C will exit top...

I don't consider myself a java expert, but changing the Xmx and Xms size and Min/Max Heap free may help you, especially with larger files.

In my case the Oracle Java caused more problems than it was worth and I moved over to the openjdk quite some time ago. You should be able to install it using "sudo apt install openjdk-8-jre", and switch back and forth between java versions by stopping serviio, using "sudo update-alternatives --config java" to change the java version , and then starting serviio back up to see if one works better than the other.

Edit: Adding a few more things for troubleshooting...

You may want to see if you can use NFS on your file share, as some NASes with SMB use SMB 1.0 which sometimes has issues with larger files.

My java options look like this (but remember I have a lot more RAM and Serviio on a RAMdisk), and the movies run lightning fast (no matter what size movie file): -Xmx8G -Xms4G -XX:+UseG1GC -XX:GCTimeRatio=1 -XX:MinHeapFreeRatio=30 -XX:MaxHeapFreeRatio=80 -Djava.net.preferIPv4Stack=true -Djava.awt.headless=true etc...

Make sure your transcoding goes to a hard disk location (like /tmp) in the console, and not a tmpfs location (like /run or /dev/shm).

Re: How to configure and optimize Serviio

PostPosted: Tue Dec 01, 2020 11:09 am
by mib182
Hello,

thanks for you reply.

I used smb v3. On server ( max protocol=SMB3) and client (//x.x.x.x/data /data cifs vers=3.0,iocharset=utf8 0 0). I use it cause I made tests with many little files and with bigger (10 or 20 GB), and SMB V3 is faster (here) than NFS.

When there are freeze and loading on my TV (samsung) I checked on server with htop (htop -d1) and top (top -d1) And I didn't see IO wait, or load or something else.

I had oracle-java8-installer and openjdk-11-jre. Now I'm trying to use the second, will see.

I'll check java options to know they changes, ans to use it.

Thanks.