-
Notifications
You must be signed in to change notification settings - Fork 36
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
High CPU usage #100
Comments
Hey @benonymus, I hope this already helps to bring some light into the case. Cheers, |
Hey @andreasknoepfle, Thanks for the quick reply!
? |
Yes, the Could you run The |
Hey, The load is consistently on that level, and I am pretty sure we are not generating that many pdfs. |
Hey @andreasknoepfle is there no default session_pool? ** (Mix) Could not start application xxxx: XXXX.Application.start(:normal, []) returned an error: shutdown: failed to start child: ChromicPDF But locally I am not getting any errors |
hey @benonymus The error reads indicates you have However, I don't think the session pool, or the background Chrome process is the reason for your high CPU load - or if it is, I'd really like to understand why, as so far I've never heard of any CPU load issues caused by an idling Chrome process. As long as you don't use it (as in, print PDFs) this process is just sitting there and doing nothing. To be able to debug your issue further, it would be really helpful if you provided us with more information. |
Hey @maltoe I think the high cpu usage is just a symptom, the compilation keeps failing and that cause the high cpu. But I am not setting session_pool in my settings, this 0 I think somehow comes from the default calculation which would mean there are 0 schedulers online. I will try to set my session_pool and report back. |
uh? interesting that during compilation you have 0 schedulers, how does it even compile anything? But that's actually a good point, it should get the number of schedulers at runtime. Will add a fix for that. |
Is the compilation failing due to ChromicPDF though? |
@maltoe Yes it looks like everything goes fine and we fail with the error I sent earlier. |
You can get the same error locally if you hard code 0 as size for the session_pool |
👍 Just found out (slight facepalm here):
If you only have 1 scheduler online (usually this means = 1 core), this will return 0. |
@maltoe Good catch! I think then it is that, we have a tiny vm. |
@maltoe Also so the compilation passes, we fail when the application tries to start as the error shows, but not important anymore. |
awesome! So and when you set the option to some value
|
Waiting for the deployment at the moment |
makes sense, I'll see if I can add a validation so people don't set that accidentally and run into the issues you were seeing. [edit] 🤔 hmm actually the exception from |
I was also wondering when you use on_demand mode, shouldn't that ignore the pool_size, or how does that interaction work? |
🤔
It should and it does, and it works for me.. ?
|
Oh right, I guess I had it mixed up with false on_demand, sorry 🥇 So if I use on_demand the pool size is always one? Edit yes it is I see |
yes, it is because the pool size becomes kind of irrelevant as the "on demand" Chrome process is only used for a single operation and then killed again. It's really only a development feature as we kept having a bunch of zombies on our dev machines, it's pretty tricky to kill external processes when the BEAM is shutdown, especially with abort from iex. Not so much an issue on production, of course. |
Yeah, that is why I was not too keen to use that option on prod if I didn't have to, plus the potential performance penalty... |
I will give an update once the release(not up to me) is out, but I am pretty confident it will work. Thanks for all the help, very cool library! |
Thanks for pointing me to this issue! Hope it'll work for you. And @andreasknoepfle is going to get sooo many emails 😄 |
Well only putting it in on_demand mode fixed the problem, seemed like just changing the pool size didn't fix it, but I think it was in some bad state, kept retrying. |
🤔 didn't fix it = you still had high CPU load? Released 0.7.1 now, pls give it a try. |
So there was high CPU load because it was stuck in this recompile loop, and that manifested itself in the high cpu usage. |
@benonymus closing this for now, feel free to re-open if you still experience issues |
Hey,
I recently switched to this library for pdf generation from wkhtmltopdf, and the cpu usage went up from 5-10% generally to 60-80+%.
Did I miss something?
Any tips?
The text was updated successfully, but these errors were encountered: