Ruby on Rails Thursday, June 22, 2017

Hey Colin, when I say it gets to ~80+% what I meant to get across is, for a 1 minute PDF Generation, it would start around 20% and quickly built to 80 - then 95 - and eventually go to 100% towards the end. I've noticed that many other users will have the application slow down dramatically during the generation of such a PDF.  It would cause much longer page loads and if they too were going to generate a PDF document then it would make problems worse. I have been attempting to background the process on Sidekiq - and am having another issue with it at the moment preventing me from seeing how it behaves in that procedure.  Though with it all using the same CPU I was guessing it wouldn't change much from what I'm already experiencing.

On Thursday, June 22, 2017 at 3:45:00 PM UTC-4, Colin Law wrote:
On 22 June 2017 at 17:08, David McDonald <dave...@gmail.com> wrote:
> I've started to use wicked_pdf and it works fine.  However, when I generate
> a PDF files, usually the CPU will get to ~80+% during the generation of the
> PDF by the wicked_pdf gem.  What's the proper way of handling this in my
> application?  I've asked around on IRC chat, stack overflow, etc, but I
> haven't been able to acquire a good answer.  People have told me to use
> Sidekiq, which I have, but this won't resolve my CPU issue unless I've put
> the job processes onto another machine it would seem.  Is there another way
> of handling this using my one server?

Why is the fact that PDF generation can use 80% of the processor a
problem? There will still be 20% available for Rails, or is that not
enough to give you the performance you require?  Linux is pretty good
at balancing processes and threads and the processor is there to be
used after all. Provided you have shelved it off into a background
process using something like sidekiq then it may well not be an issue.
Try it and see. if it becomes an issue then you can look at more
complex solutions.  My philosophy is always to start off using the
KISS principle.

Colin

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-talk+unsubscribe@googlegroups.com.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/c3885f81-ea1a-4fc6-a396-f798a2c5862e%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

No comments:

Post a Comment