jocxfin / pwgen

Simple self hosted password generator
GNU Affero General Public License v3.0
53 stars 3 forks source link

Docker Container is unhealthy on my Synology NAS (but appears to work) - can this be fixed? #80

Open cleverestx opened 6 months ago

cleverestx commented 6 months ago

Concerned about a memory leak or other issues though. How do I fix this?

image

[2024-04-09 03:37:48 +0000] [32272] [INFO] Booting worker with pid: 32272

[2024-04-09 03:37:52 +0000] [1] [CRITICAL] WORKER TIMEOUT (pid:32271)

[2024-04-09 03:37:52 +0000] [1] [CRITICAL] WORKER TIMEOUT (pid:32272)

[2024-04-09 03:37:53 +0000] [1] [ERROR] Worker (pid:32271) was sent SIGKILL! Perhaps out of memory?

[2024-04-09 03:37:54 +0000] [1] [ERROR] Worker (pid:32272) was sent SIGKILL! Perhaps out of memory?

[2024-04-09 03:37:55 +0000] [32282] [INFO] Booting worker with pid: 32282

[2024-04-09 03:37:55 +0000] [32283] [INFO] Booting worker with pid: 32283

[2024-04-09 03:37:59 +0000] [1] [CRITICAL] WORKER TIMEOUT (pid:32282)

[2024-04-09 03:37:59 +0000] [1] [CRITICAL] WORKER TIMEOUT (pid:32283)

[2024-04-09 03:38:00 +0000] [1] [ERROR] Worker (pid:32282) was sent SIGKILL! Perhaps out of memory?

[2024-04-09 03:38:00 +0000] [1] [ERROR] Worker (pid:32283) was sent SIGKILL! Perhaps out of memory?

[2024-04-09 03:38:00 +0000] [32284] [INFO] Booting worker with pid: 32284

[2024-04-09 03:38:02 +0000] [32285] [INFO] Booting worker with pid: 32285

[2024-04-09 03:38:04 +0000] [1] [CRITICAL] WORKER TIMEOUT (pid:32284)

[2024-04-09 03:38:05 +0000] [1] [ERROR] Worker (pid:32284) was sent SIGKILL! Perhaps out of memory?

[2024-04-09 03:38:05 +0000] [32286] [INFO] Booting worker with pid: 32286

[2024-04-09 03:38:06 +0000] [1] [CRITICAL] WORKER TIMEOUT (pid:32285)

[2024-04-09 03:38:07 +0000] [1] [ERROR] Worker (pid:32285) was sent SIGKILL! Perhaps out of memory?

[2024-04-09 03:38:07 +0000] [32287] [INFO] Booting worker with pid: 32287

[2024-04-09 03:38:09 +0000] [32286] [INFO] Started server process [32286]

[2024-04-09 03:38:09 +0000] [32287] [INFO] Started server process [32287]

[2024-04-09 03:38:09 +0000] [32287] [INFO] Waiting for application startup.

[2024-04-09 03:38:09 +0000] [32286] [INFO] Waiting for application startup.

[2024-04-09 03:38:09 +0000] [32286] [INFO] ASGI 'lifespan' protocol appears unsupported.

[2024-04-09 03:38:09 +0000] [32287] [INFO] ASGI 'lifespan' protocol appears unsupported.

[2024-04-09 03:38:09 +0000] [32286] [INFO] Application startup complete.

[2024-04-09 03:38:09 +0000] [32287] [INFO] Application startup complete.

[2024-04-09 03:54:13 +0000] [1] [CRITICAL] WORKER TIMEOUT (pid:32286)

[2024-04-09 03:54:18 +0000] [1] [ERROR] Worker (pid:32286) was sent SIGKILL! Perhaps out of memory?

[2024-04-09 03:54:20 +0000] [32529] [INFO] Booting worker with pid: 32529

[2024-04-09 03:54:24 +0000] [1] [CRITICAL] WORKER TIMEOUT (pid:32529)

[2024-04-09 03:54:25 +0000] [1] [ERROR] Worker (pid:32529) was sent SIGKILL! Perhaps out of memory?

[2024-04-09 03:54:25 +0000] [32530] [INFO] Booting worker with pid: 32530

[2024-04-09 03:54:29 +0000] [1] [CRITICAL] WORKER TIMEOUT (pid:32530)

[2024-04-09 03:54:29 +0000] [1] [ERROR] Worker (pid:32530) was sent code 134!

[2024-04-09 03:54:29 +0000] [32531] [INFO] Booting worker with pid: 32531

[2024-04-09 03:54:33 +0000] [1] [CRITICAL] WORKER TIMEOUT (pid:32531)

[2024-04-09 03:54:34 +0000] [1] [ERROR] Worker (pid:32531) was sent code 134!

[2024-04-09 03:54:34 +0000] [32532] [INFO] Booting worker with pid: 32532

[2024-04-09 03:54:38 +0000] [1] [CRITICAL] WORKER TIMEOUT (pid:32532)

[2024-04-09 03:54:38 +0000] [1] [ERROR] Worker (pid:32532) was sent code 134!

[2024-04-09 03:54:38 +0000] [32533] [INFO] Booting worker with pid: 32533

[2024-04-09 03:54:42 +0000] [1] [CRITICAL] WORKER TIMEOUT (pid:32533)

[2024-04-09 03:54:43 +0000] [1] [ERROR] Worker (pid:32533) was sent SIGKILL! Perhaps out of memory?

[2024-04-09 03:54:43 +0000] [32534] [INFO] Booting worker with pid: 32534

[2024-04-09 03:54:46 +0000] [32534] [INFO] Started server process [32534]

[2024-04-09 03:54:46 +0000] [32534] [INFO] Waiting for application startup.

[2024-04-09 03:54:46 +0000] [32534] [INFO] ASGI 'lifespan' protocol appears unsupported.

[2024-04-09 03:54:46 +0000] [32534] [INFO] Application startup complete.

Desktop (please complete the following information):

jocxfin commented 6 months ago

Hi! Thanks for reporting this. I'll take a look and come back to you if I have any questions.

jocxfin commented 6 months ago

@cleverestx There seems not to be any memory leaking as far as i have checked. How much of memory is free on your system? Could it be that your system is running our of reserved memory? Seems like your synology should have 4gb of ram. I tried to overload the memory by opening 100 sessions of the application without caching and it never went over 200MB and i never saw any issues you have.

This is the pwgen.joonatanh.com docker and even with approximately 200 unique users per day, there is absolutely no issues with the memory:

image
cleverestx commented 6 months ago

Thank you for the details. I have 20GB of RAM on my NAS and to my knowledge, I should have about 8GB free at any given time, even with other stuff running...

I'll double check the actual usage tonight though.... I was just concerned that it was saying it was unhealthy, and those logs...

On Tue, Apr 9, 2024, 7:19 AM jocxfin @.***> wrote:

@cleverestx https://github.com/cleverestx There seems not to be any memory leaking as far as i have checked. How much of memory is free on your system? Could it be that your system is running our of reserved memory? Seems like your synology should have 4gb of ram. I tried to overload the memory by opening 100 sessions of the application without caching and it never went over 200MB and i never saw any issues you have.

This is the pwgen.joonatanh.com docker and even with approximately 200 unique users per day, there is absolutely no issues with the memory: image.png (view on web) https://github.com/jocxfin/pwgen/assets/19174728/d81d746c-6ed5-46f0-af8c-88fc0dba3599

— Reply to this email directly, view it on GitHub https://github.com/jocxfin/pwgen/issues/80#issuecomment-2045163561, or unsubscribe https://github.com/notifications/unsubscribe-auth/AG4Q6JLKYV4ORLU3JYWXFALY4PTFZAVCNFSM6AAAAABF55ELUOVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDANBVGE3DGNJWGE . You are receiving this because you were mentioned.Message ID: @.***>

jocxfin commented 6 months ago

I actually took some time and tried to research this issue. As I double checked, there should not be any memory leaking even after long time. Only thing I found, was a Synology update causing a general memory leakage, but this happened in 2021 and they fixed that with an update. But they said that if users are still having issues with memory leaks, removing the container and re-deploying it should stop that. So maybe give that a go? I also thought maybe it's due to the amount of workers present (by default 2 and 4 threads) so I'll make a dev build soon where there will be the possibility to use the envs WORKERS and THREADS for defining them.

Edit: my bad, apparently i already had made the change and it should be available in jocxfin/pwgen-dev if you want to test. Just add new envs for WORKERS=1 and THREADS=2

cleverestx commented 6 months ago

Thank you! I will check it out soon!

cleverestx commented 6 months ago

The DEV PWgen works, same as before, but once again Portainer shows unhealthy, and I get this:

image

hammaschlach commented 5 months ago

I have the exact same problem on my synology with 20GB.

SCR-20240426-gxid