I am currently running Apache / mod_perl with a PSGI application called Plack :: Handler :: Apache2. The problem is that every Apache process uses a connection to a PostgreSQL database, which is expensive. To solve this problem, we plan to launch the PSGI application separately from Apache and allow all Apache processes to communicate with it through a UNIX domain socket. What setting would you recommend in my case?
My plan is to run it with plackup:
plackup -s FCGI -E production --nproc 100 --daemonize --listen /tmp/myapp.sock \
/usr/local/bin/myapp.psgi
I asked Plack's author, Tatsuhiko Miyagawa, if plackup -s FCGI is recommended for production purposes. He gave the following answer:
"although it can be used for production, I usually recommend using other specialized servers, such as Starman, Starlet or uwsgi. FCGI is an exception because we do not have a specific FCGI daemon other than default Plack :: Handler. We have a plan split up FCGI from Plack and make it a separate installation. "
Now, until FCGI is split into Plack, the question is, what is the best way to run a PSGI application using FastCGI outside of Apache?
source
share