You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
source /etc/profile
#prep suffix
emerge dev-java/openjdk:21 tomcat:9 pwgen
useradd -m -G users,wheel,realtime -s /bin/bash scadalts
/usr/share/tomcat-9/gentoo/tomcat-instance-manager.bash --create --suffix scadalts --user scadalts --group scadalts
echo 'TOMCAT_JVM="openjdk-21"' >> /etc/conf.d/tomcat-9-scadalts
echo 'JAVA_OPTS="-Djava.library.path=/usr/lib --add-opens=java.base/java.lang=ALL-UNNAMED --add-opens=java.base/java.io=ALL-UNNAMED \
--add-opens=java.base/java.util=ALL-UNNAMED --add-opens=java.base/java.util.concurrent=ALL-UNNAMED --add-opens=java.rmi/sun.rmi.transport=ALL-UNNAMED \
-Xms512m -Xmx512m -Djdk.tls.ephemeralDHKeySize=2048 -Djava.protocol.handler.pkgs=org.apache.catalina.webresources -Dorg.apache.catalina.security.SecurityListener.UMASK=0027 -Dignore.endorsed.dirs="' >> /etc/conf.d/tomcat-9-scadalts
echo 'CATALINA_OPTS="-Xmx2G -Xms2G"' >> /etc/conf.d/tomcat-9-scadalts
#jars
cd /var/lib/tomcat-9-scadalts/webapps
#Download latest Scada-LTS 2.8.0 snapshot, 2.7.8 does not work due to wrong CATALINA_HOME
mkdir /var/lib/tomcat-9-scadalts/lib
cd /var/lib/tomcat-9-scadalts/lib
wget https://github.com/SCADA-LTS/Scada-LTS/raw/refs/heads/develop/tomcat/lib/activation.jar
wget https://github.com/SCADA-LTS/Scada-LTS/raw/refs/heads/develop/tomcat/lib/jaxb-api-2.4.0-b180830.0359.jar
wget https://github.com/SCADA-LTS/Scada-LTS/raw/refs/heads/develop/tomcat/lib/jaxb-core-3.0.2.jar
wget https://github.com/SCADA-LTS/Scada-LTS/raw/refs/heads/develop/tomcat/lib/jaxb-runtime-2.4.0-b180830.0438.jar
wget https://github.com/SCADA-LTS/Scada-LTS/raw/refs/heads/develop/tomcat/lib/mysql-connector-java-5.1.49.jar
#move logs to standard folder
ln -s /var/log/tomcat-9-scadalts /var/lib/tomcat-9-scadalts/logs
mkdir /usr/share/tomcat-9/static
mkdir /usr/share/tomcat-9/static/graphics
chown -R scadalts:scadalts /usr/share/tomcat-9/static/graphics
#optional, map to privileged 80 port and root redirect
sed -i -e 's/8080/80/g' /etc/tomcat-9-scadalts/server.xml
setcap 'cap_net_bind_service=+ep' /usr/lib64/openjdk-21/bin/java
rm /var/lib/tomcat-9-scadalts/webapps/ROOT/index.jsp
echo '<% response.sendRedirect("/Scada-LTS"); %>' > /var/lib/tomcat-9-scadalts/webapps/ROOT/index.jsp
chown scadalts:scadalts /var/lib/tomcat-9-scadalts/webapps/ROOT/index.jsp
#optional, if crappy storage, tmp folder in ramdisk
mkdir /var/tmp/tomcat-9-scadalts
chown scadalts:scadalts /var/tmp/tomcat-9-scadalts
echo 'tmpfs /var/tmp/tomcat-9-scadalts tmpfs rw,uid=1001,gid=1002,size=32M,nr_inodes=10k,mode=0700 0 0' >> /etc/fstab
mount -a
#edit for db credentials /var/lib/tomcat-9-scadalts/conf/context.xml and you're done
#if empty local MariaDB does not want to populate, dump it from another working x86 install and import
rc-service tomcat-9-scadalts start
Different arch SBCs performance testing
Using one db, dumped and imported to test SBCs, with around 400 Modbus TCP points @ 250-1000ms, some IEC101 signals and http retrievers.
Debian systems are vanilla without any tweaks, only set governor to performance, although it seems on x86 intel_pstate ignores it. Gentoo is heavily tweaked.
Celeron J4125, MELE PCG02 eMMC
Linux rtr 6.1.0-31-amd64 #1 SMP PREEMPT_DYNAMIC Debian 6.1.128-1 (2025-02-07) x86_64 GNU/Linux
Scada-LTS docker; MariaDB native
JVM 11.0.22+7 Eclipse Adoptium
org.apache.catalina.startup.Catalina.start Server startup in [26004] milliseconds
24h load average: 0.47
ResetCacheHighestAlarmLevel [6] ms
Avg. consumption 2.2W
Cortex-A72, RPi CM4 8GB RAM / 32GB eMMC no WiFi
Linux raspberrypi 6.6.77-v8+ #1851 SMP PREEMPT Thu Feb 13 13:01:11 GMT 2025 aarch64 GNU/Linux
Scada-LTS docker; MariaDB native
JVM 11.0.22+7 Eclipse Adoptium
org.apache.catalina.startup.Catalina.start Server startup in [60512] milliseconds
24h load average: 0.24
ResetCacheHighestAlarmLevel [3] ms
Avg. consumption 3.5W
JH7110, Milk-V Mars CM 2GB RAM / 8GB eMMC no WiFi
Linux ems.nsa 6.12.13-gentoo-riscv64 #26 SMP PREEMPT_DYNAMIC Tue Feb 11 22:57:50 EET 2025 riscv64 GNU/Linux
Scada-LTS native; MariaDB native
JVM 21.0.6+7 native
org.apache.catalina.startup.Catalina.start Server startup in [76260] milliseconds
24h load average: 0.21
ResetCacheHighestAlarmLevel [1] ms
Avg. consumption 2.7W
rv64 cores, even without vector extensions, are not that slow as many benchmarks are showing them.
How to optimize for a healthy balance of performance and latency on SBCs
Isolate kernel threads, interrupts (kthread_cpus=0, irqaffinity=0) to first core. Using cgroups isolate all system services to first core, leave 3 cores for MariaDB and Scada-LTS.
Enable preemption (preempt=full).
Upgrade to NVMe. If not possible, move tmp to ramdisk, decrease db writes by not logging or infrequent logs of unneeded points.
Run natively to avoid container overhead. This strongly impacts latency.
Compile OpenJDK natively with -mcpu= and -mtune= for specific CPU. On a source based distro even better - entire system, with LTO, PGO etc.
Build a minimalistic monlithic kernel.
Strip down more overhead such as Systemd. For example benchmarked OpenRC system has only init, agetty, fcron, sshd, chronyd, rsyslogd.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
-
Script to run natively on Gentoo rv64
Different arch SBCs performance testing
Using one db, dumped and imported to test SBCs, with around 400 Modbus TCP points @ 250-1000ms, some IEC101 signals and http retrievers.
Debian systems are vanilla without any tweaks, only set governor to performance, although it seems on x86 intel_pstate ignores it. Gentoo is heavily tweaked.
rv64 cores, even without vector extensions, are not that slow as many benchmarks are showing them.
How to optimize for a healthy balance of performance and latency on SBCs
Need futher testing:
Additional context
2.7.8 currently has CATALINA_HOME path problems on native Gentoo. Run 2.8.0.
catalina.2025-01-09.log
flyway.log
localhost.2025-01-09.log
mango.log
Beta Was this translation helpful? Give feedback.
All reactions