title: Best way to run a Plack PSGI Perl application outside of Apache using FastCGI?
body: <p>I'm currently running Apache/mod_perl with a PSGI-application invoked by Plack::Handler::Apache2. The problem we have is each Apache process consumes a connection to the PostgreSQL database, which is expensive. To solve this, we plan to run the PSGI-application separate from Apache, and let all Apache processes communicate with it over a UNIX domain socket. What setup would you recommend in my case?</p>
  
  <p>My plan is to run it using plackup:</p>
  
  <pre><code>plackup -s FCGI -E production --nproc 100 --daemonize --listen /tmp/myapp.sock \
  /usr/local/bin/myapp.psgi
  </code></pre>
  
  <p>I asked the author of Plack, Tatsuhiko Miyagawa, if plackup -s FCGI is recommended for production purposes. He provided the following answer:</p>
  
  <blockquote>
    <p>"while it could be used for production, i usually recommend using other
    specialized servers such as Starman, Starlet or uwsgi. FCGI is an
    exception because we don't have a specific FCGI daemon other than the
    default Plack::Handler. We have a plan to split out FCGI out of Plack
    core and make that a separate installation."</p>
  </blockquote>
  
  <p>Now, until FCGI is splitted out of Plack, the question is therefore, what is the best possible way to run a PSGI application using FastCGI outside of Apache?</p>