line / promgen

Promgen is a configuration file generator for Prometheus
https://line.github.io/promgen/
MIT License
1.04k stars 150 forks source link

Some page loading is slow (docker compose) #449

Open sh-cho opened 8 months ago

sh-cho commented 8 months ago
image image

It takes more than 30 seconds to load.

Looks like it only happens in main page and login page. /url, /rule, /service pages are ok.

docker compose up -d
docker compose run web docker-compose-bootstrap

I set up my environment with this commands

$ docker compose run web createsuperuser
[+] Creating 2/0
 ✔ Container promgen-redis-1  Running                                                                                                                          0.0s
 ✔ Container promgen-mysql-1  Running                                                                                                                          0.0s
/docker-entrypoint.sh: exec: line 42: createsuperuser: not found

(FYI, It didn't work, so I attached web container and executed promgen createsuperuser inside)

logs

2023-11-06 22:39:56 promgen-web-1           | [2023-11-06 13:39:56 +0000] [1] [CRITICAL] WORKER TIMEOUT (pid:63)
2023-11-06 22:39:56 promgen-web-1           | [2023-11-06 13:39:56 +0000] [63] [INFO] Worker exiting (pid: 63)
2023-11-06 22:39:56 promgen-web-1           | [2023-11-06 13:39:56 +0000] [1] [ERROR] Worker (pid:63) exited with code 1
2023-11-06 22:39:56 promgen-web-1           | [2023-11-06 13:39:56 +0000] [1] [ERROR] Worker (pid:63) exited with code 1.
2023-11-06 22:39:56 promgen-web-1           | [2023-11-06 13:39:56 +0000] [65] [INFO] Booting worker with pid: 65
2023-11-06 22:40:00 promgen-mysql-1         | 2023-11-06T13:40:00.807959Z 121 [Warning] [MY-013360] [Server] Plugin mysql_native_password reported: ''mysql_native_password' is deprecated and will be removed in a future release. Please use caching_sha2_password instead'
2023-11-06 22:40:01 promgen-mysql-1         | 2023-11-06T13:40:01.585994Z 122 [Warning] [MY-013360] [Server] Plugin mysql_native_password reported: ''mysql_native_password' is deprecated and will be removed in a future release. Please use caching_sha2_password instead'
2023-11-06 22:40:01 promgen-mysql-1         | 2023-11-06T13:40:01.632003Z 123 [Warning] [MY-013360] [Server] Plugin mysql_native_password reported: ''mysql_native_password' is deprecated and will be removed in a future release. Please use caching_sha2_password instead'

If I enter to slow page(main or login), I can see worker timeout and exiting logs

my environment

kfdm commented 8 months ago

Hmm, I just tried a test with docker-compose myself, but I'm not seeing any slowdown on a new install. My regular development install has a lot of data, but even with that I'm not seeing any unexpected slowdowns (there are a few places I know that are slow, but I'm not seeing 30 seconds slow anywhere)

It's going to be difficult for me to allocate time for this right now, but if you can narrow down a bit more of a test case, that'll help me know what to check.

/docker-entrypoint.sh: exec: line 42: createsuperuser: not found

There might be a few places like that which should be prefixed with promgen as the base command. I will try to check and update the docs later 🙇

sh-cho commented 8 months ago

Ok I'll check more later :)

What version of docker-compose do you use? (check with docker-compose version)

Maybe it is related to docker compose issue. Since recent compose spec is 3.8 and promgen's compose version is 2. And I use docker compose V2(docker compose), which actually ignores version in compose.yml and uses latest scheme. (docker compose cli versioning docs). Probably it's the reason?

Anyway docker compose V1(docker-compose) is not supported anymore, I think it is good to update compose.yml up-to-date. I'll make a patch if it's ok 😃