6
votes

I have a rails app that uses PDFKit to render pdf versions of webpages. I use Thin as a development server.

The problem is that when i'm in development mode. When I start my server with "bundle exec rails s" and I try to render any PDF the whole process gets deadlocked because when you render a PDF some extra resources like images and css are requested to the server and looks like there is a single thread.

How can I configure rails development server to run multiple worker threads?

Thanks a lot.

1

1 Answers

11
votes

The simplest solution I have found is unicorn.

gem install unicorn

Create a unicorn.conf:

worker_processes 3

And then to use it:

my_gem_tree/bin/unicorn_rails -c unicorn.conf