-
Notifications
You must be signed in to change notification settings - Fork 4.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Redash doesn't start if CPU is too slow #1866
Comments
Can you provide more details on this -- I mean, how did you deduce it tries to compile something? |
I saw To reproduce, start an instance of redash:
In another terminal, look at the container's process list:
(This may take a few tries depending on the timing.) Using |
Actually, it's easier to reproduce it if you start it like this:
This limits it to 10% of one CPU. On my development environment (a Linux Hyper-V VM on an Intel i7-3770K 3.5GHz CPU) this is sufficient to make the
|
Thanks! I recently started seeing similar symptoms in my environment, and wanted to confirm we're talking about the same thing. I'm now trying to figure out what causes this and whether it can be avoided. Running |
This is coming from pycryptodome, and I'm fairly sure it's related to how it uses CFFI at runtime. Unfortunately, I know almost nothing about cffi so I don't know why it would need to invoke gcc. (The cffi documentation does mention it would do this in "out-of-line API mode".) Perhaps it's sufficient to import the relevant pycryotodome modules in Dockerfile during build, so it pre-compiles them? That would obviously only fix it for Docker though; I don't know if this problem happens on non-Docker installations as well. |
Have you tried a longer gunicorn timeout like this in bin/docker-entrypoint?
|
@deecay while extending the timeout might help with this specific issue, there is no reason Redash should take so long to boot. @unixwitch the Snowflake query runner was bringing in pycryptodome, and causing this. Just disabling the Snowflake query runner isn't enough to resolve this, and you will need to remove its library from the Btw, how did you find it's pycryptodome?
From what I've seen, it runs this step on every run of the code and doesn't cache this compilation step :-( |
Issue Summary
Redash attempts to compile something (I'm not sure what) during startup. If the CPU isn't fast enough, this takes so long that Gunicorn times out the workers:
This repeats in an endless loop and it never manages to start.
Steps to Reproduce
Any other info e.g. Why do you consider this to be a bug? What did you expect to happen instead?
This may seem like a "well don't do that then" issue, but we generally limit applications' CPU use based on how much they typically need while running, to avoid a broken application slowing down everything else. I don't mind Redash being a bit slow to start as long as it actually does.
Technical details:
The text was updated successfully, but these errors were encountered: