Hello again,
 
sorry, I forgot to mention we never had any luck using the “builtin” OOM 
features of systemd, so we added this to the “start” switch-case-directive in 
/etc/init.d/sogo (see below):
 
(the line is echo -100 > /proc/$(cat $PIDFILE)/oom_score_adj)
 
-→ this ensures the parent PID _virtually_ will never die.
 
case "$1" in
 start)
       log_daemon_msg "Starting $DESC" "$NAME"
       # Enforce directory existence and permissions
       install -o $USER -g $USER -m 775 -d /var/run/$NAME
       install -o $USER -g $USER -m 770 -d /var/spool/$NAME
       install -o $USER -g $USER -m 770 -d /var/log/$NAME
       if ! start-stop-daemon -c $USER --quiet --start --pidfile $PIDFILE 
--exec $DAEMON -- $DAEMON_OPTS 
       then
           log_progress_msg "already running"
       fi
       [ -e $PIDFILE ] && chown root:root $PIDFILE && echo -100 > /proc/$(cat 
$PIDFILE)/oom_score_adj
       log_end_msg 0
       ;;

 
Best regards,
 
Alex


Am Mittwoch, Juli 30, 2025 14:04 CEST, schrieb "Alexander Mischke" 
<[email protected]>:

 
Hello Frank,
 
we created a systemd override file (Debian 12):
(this works in our case, other than that we use the “old style” LSB service 
file which is shipped with SOGo)
 
# /etc/systemd/system/sogo.service.d/override.conf
[Service]
#MemoryHigh=13000M
#MemoryMax=14000M
Restart=on-failure
RestartSec=5s

 
Best regards,
 
Alex


Am Mittwoch, Juli 30, 2025 13:49 CEST, schrieb "Frank Richter" 
([email protected]) <[email protected]>:

 
Hello,

yesterday on one of our SOGo servers  sogod was killed  by Linux’ oom-killer 
– kernel log:
Out of memory: Killed process 2184654 (sogod) …

Prior this we saw a massive increase in memory usage within 30 seconds. In 
sogo.log we see:

2025-07-29 15:12:27.621 sogod[1672:2184654] WARNING(-[NGBufferedStream 
writeBytes:count:]): got passed in length 190MB (199833590 bytes, 
errcode=2147483647) ...
…
Jul 29 15:12:38 sogod [1672]: <0x0x564af06caa30[WOWatchDogChild]> child 
2184654 exited
Jul 29 15:12:38 sogod [1672]: <0x0x564af06caa30[WOWatchDogChild]>  
(terminated due to signal 9)

After this all sogo processes where terminated by further oom-killer 
actions. Not good at all.

sogod runs with -WOWorkersCount 50, config sets SxVMemLimit = 512;
The server’s memory is 16 GBytes. This is usually sufficient, but might be 
not: 50 * 512 M > 16 G

What does the WARNING (-[NGBufferedStream writeBytes:count:]) … log mean? We 
saw some of them.
Has anybody written a systemd unit file for sogo … with Restart=on-failure?

Any further hints welcome!

Thanks,
Frank

-- 
Frank Richter, Chemnitz University of Technology, Germany

 

-- 
 Alexander MischkeLAYERTEC GmbH
Ernst-Abbe-Weg 1
99441 Mellingen
GERMANYTel: +49 36453 744 754
Fax: +49 36453 744 40
Web: 
https://www.layertec.de______________________________________________________________________________
LAYERTEC GmbH
CEO (Geschäftsführung): Alexander Ancsin, Hartmut Heyer
Court of Registry (Amtsgericht) Jena HRB 513793
VAT No. (USt.Nr.) DE 313635443

-- 
 Alexander MischkeLAYERTEC GmbH
Ernst-Abbe-Weg 1
99441 Mellingen
GERMANYTel: +49 36453 744 754
Fax: +49 36453 744 40
Web: 
https://www.layertec.de______________________________________________________________________________
LAYERTEC GmbH
CEO (Geschäftsführung): Alexander Ancsin, Hartmut Heyer
Court of Registry (Amtsgericht) Jena HRB 513793
VAT No. (USt.Nr.) DE 313635443

Reply via email to