Stunnel4 allocates too much memory
During a deploy to aardwolf I got this error: - [aardwolf] Error: Could not get latest version: Cannot allocate memory - fork(2)
I logged into aardwolf and saw that stunnel4 was eating most of the RAM:
top - 07:50:16 up 121 days, 16:53, 1 user, load average: 0.11, 0.16, 0.19
Tasks: 68 total, 1 running, 67 sleeping, 0 stopped, 0 zombie
%Cpu(s): 2.9 us, 2.2 sy, 0.0 ni, 94.2 id, 0.0 wa, 0.0 hi, 0.0 si, 0.7 st
KiB Mem: 2033000 total, 1899216 used, 133784 free, 0 buffers
KiB Swap: 0 total, 0 used, 0 free. 137236 cached Mem
PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND
16995 stunnel4 20 0 2019120 1.488g 1320 S 0.0 76.7 101:27.40 stunnel4
The stunnel logs were completely fine, same for the stunnel service:
root@aardwolf:~# systemctl status stunnel4.service
● stunnel4.service - LSB: Start or stop stunnel 4.x (SSL tunnel for network daemons)
Loaded: loaded (/etc/init.d/stunnel4)
Active: active (running) since Tue 2017-07-18 13:27:19 UTC; 1 months 20 days ago
CGroup: /system.slice/stunnel4.service
└─16995 /usr/bin/stunnel4 /etc/stunnel/couch_server.conf
root@aardwolf:~# dpkg -l stunnel4
Desired=Unknown/Install/Remove/Purge/Hold
| Status=Not/Inst/Conf-files/Unpacked/halF-conf/Half-inst/trig-aWait/Trig-pend
|/ Err?=(none)/Reinst-required (Status,Err: uppercase=bad)
||/ Name Version Architecture Description
+++-==============================================-============================-============================-==================================================================================================
ii stunnel4 3:5.30-1~bpo8+1 amd64 Universal SSL tunnel for network daemons
After a restart everything was fine again. I'm leaving this issue mainly for documentation purposes.