Hi all,

I am currently implementing stunnels on an Ubuntu 18.04 container running Magento 2 connecting to AWS Elasiticache (Redis)  with the following configuration:

Master:

fips = no
setuid = nobody
setgid = nogroup
pid = /home/agent/pids/redis-master.pid
debug = 1
delay = yes
[redis-cli]
  client = yes
  accept = 127.0.0.1:8000
  connect = master.awsurl:6379

and the exact same config for the read replica with different "connect" and "accept" values of course.

Everything works great except that the container host becomes unresponsive after a few days. Doing a screenshot of the console shows that the host is out of memory and mentions stunnel4 in the same error message. Upon further digging, I found that running the tunnels progressively eats away at RAM over time. Look at the logs when setting debug to 7 shows the following suspect error message:

Possible memory leak at ../crypto/asn1/asn1_lib.c:295: 28363 allocations

Does anyone have any thoughts on this? Is it a usage/configurations issue or did I discover a memory leak here? If it is in fact a memory leak, does running a later version fix this? Is there a recommended version that I should try to run that's known to work well with Ubuntu 18.04?

Thanks a lot in advance for any help on this issue!

Regards,

Jeremy

3DF Open Source Initiative
Mail: hkdb@3df.io
Web: https://osi.3df.io