Skip to content

Requirements

tesshu.com edited this page Feb 7, 2024 · 7 revisions

Overview

This page describes the environment required for Jpsonic to operate and memory settings. Especially in the case of the initial scan, how fast you can achieve it will depend strongly on your hardware configuration and performance, and its settings. It maintains the same ease of deployment that many Sonic servers maintain. However, if you're looking for more comfortable speeds, keep in mind that there are some tricks.

System Requirements

Jpsonic was developed so as not to raise the requirements too much compared to legacy servers. Subsonic/Airsonic/Jpsonic can be run on a PC with roughly the same specs.

Hardware Prerequisites

  • CPU: Same as Subsonic/Airsonic requirements. Intel Celeron J4025(2core 2thread 2.00 GHz) or higher CPU recommended.
  • Memory:
    • For Standalone: Minimum 512 MB physical memory (and the memory required for the JVM sub-process to run)
    • For Docker: Minimum 896 MB physical memory

Platform, Supported Versions

    1. For Standalone
    • OS : OS that can run Java
    • Java : Java 17, 21
    1. When using Application Server
    • Satisfy condition 1 and satisfy Servlet version 6.0. One of the following is known to work:
      • Tomcat : 10.1.x
      • Jetty : 12.0.x
    1. When using Docker
    • You don't have to care about Java,App Server, or fffmpeg versions. The latest will always be provided.
    • production.synology.yml will be provided. Although it is highly compatible with Synology, it can also be used with regular Linux.

Important Note

Please consider suppressing Swap due to the characteristics of the app. Jpsonic's memory sizing takes into consideration swap suppression.

  • For Linux:
    • Swappiness is recommended to be 10 or less. There will be a huge impact on scan speed. Jpsonic has been tested to operate between 1 and 60.
    • Or consider using Docker. Swappiness is specified as 1 in production.synology.yml.

Memory Requirements

The memory used changes depending on the number of songs.

image

Please specify the same value for Xms and Xmx. An example of the shortest Java command is as below :

java -Xms512m -Xmx512m -XX:MaxGCPauseMillis=500 -jar jpsonic.war

Selection of Garbage collectors

If you don't add the GC Option, it will be auto-selected by the JVM. For CPUs J4025 and above, G1 GC would be recommended. Or, in most cases, G1 GC is automatically selected without adding Option. The current JVM default is G1 GC.

java -Xms512m -Xmx512m -XX:+UseG1GC -XX:MaxGCPauseMillis=500 -jar jpsonic.war

For CPUs with lower performance than J4025, Serial GC may be more suitable. Please pay close attention to the CPU load and processing time.

java -Xms512m -Xmx512m -XX:+UseSerialGC -XX:MaxGCPauseMillis=500 -jar jpsonic.war

You can check which GC is being used from the web page.

image

Typical platform examples - Synology Plus Series

Synology DS220+ and Docker is used for Jpsonic's operation test. Therefore, it is highly affinity with the Synology Plus series. The distributed production.synology.yml can be used with the standard configuration of DS220+, and with a little rewriting, it can be used with general Linux.

DS220+ memory construction example

This setting is supposed to use the memory of the DS220+ as follows :

243127031-6bda773b-307c-4397-b580-d7f713d332e2

DS220+ was selected based on the following points of view:

  • The DS220+ seems to have a good balance between practical performance and price as an entry model spec. The total cost of the main unit, 4Tb hard disk, and 8Gb memory is almost the same as the contract fee for 5 years of music subscription.
  • When using Docker on Synology NAS, you will inevitably choose Plus Series. DS220+ is the most affordable of the Plus Series, and it is also not the latest (a successor has been released). Even if we use the DS220+'s performance to its limits, it will still work with all Synology Plus Series models.
  • DS220+ has a CPU with emphasis on cost performance. (In fact, the maintenance cost of its power consumption can also be kept low.) If you do not optionally specify GC, G1 GC will be used if the maximum memory allocated to the JVM is sufficient. Otherwise it's Serial GC. It's spec roughly between a legacy environment and a high spec environment.
  • Even including the OS area of DSM, it can manage 100K 5min-FLAC songs with 4Tb HDD. Most users will be well below this number of songs.
    • Although full-scale speed improvements have not been made yet, as of 112.2.3 it is approximately 8 minutes/100K 5min-FLAC songs in initial scan. Not bad. (Reasonable effort: Please note that it is affected by platform side caching)
    • Of course, I'm estimating it a little extra. The average duration of general rock and pop music is often less than 5 minutes. Also, if the format has a higher compression ratio, the number of files that can be accommodated will increase. In reality, even standard memory should be able to withstand up to about 130K. Also, if you increase the memory, you will be able to manage even more songs.