Best way to run a Plack PSGI Perl application outside of Apache using FastCGI?

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?

+4
source share
1 answer

FastCGI, Apache FastCGI mod_fastcgi FastCgiExternalServer ( , mod_fcgid ). FCGI, Plack.

, , , Starman Starlet, - HTTP. , mod_proxy Apache. Apache 2.4.7 Unix.

+1

Source: https://habr.com/ru/post/1542752/


All Articles