On Jun 2, 2017, at 5:05 AM, hw hw@gc-24.de wrote:
Warren Young wrote:
There are various options. We use mod_fcgid + Plack here.
I need to look into that when I have time.
I wonder if it wouldn’t have been faster to just backport the app to Perl 5.16? How hard could it be? It’s not like Perl 5.16 is a hopelessly lame and incapable language.
The recommendation to replace mod_perl with mod_fcgid comes from the RHEL 7 release notes: http://goo.gl/fZxHw9
After sending that message, I remembered that we rejected that option once we found out that when you build your app under Plack, it serves content via a Perl web server using a standard interface called PSGI. That Perl web server normally binds to localhost on a high-numbered TCP port, so we just stood Apache up in front of it as a reverse proxy. That avoids the security hassles of binding to TCP port 80, and it lets us foist the static content serving load off on Apache, so that the Perl layer serves only dynamic content.
There are many PSGI-aware web servers:
The default used by Plack is HTTP::Server::Simple, which is probably fast enough for your purposes if CGI remains appropriate for your app.
If you were already trying to get off CGI to make the app faster, many of the alternatives in that list will get you that speed.
The mod_fcgid method may be easier to port to, since you’re already using CGI, however.
Test have shown that lighttpd apparently is somewhat faster than apache2
This is generally true only at fairly high loads, up in the thousands of connections per second. Distinguishing this also requires that the bottleneck be in the web server, not in the web app it’s serving.
Since your app is currently running via CGI, one of two conditions is true:
1. You have chosen well: CGI is appropriate for your application, in which case all web servers with the features you need are interchangeable, because the bottleneck is CGI, not the web server.
2. You have chosen poorly: CGI is slowing your app down enough that end users notice the speed hit, in which case you need to get off CGI before you start chasing nonstandard web servers, because speeding up the web server won’t solve the primary bottleneck.
(“Nonstandard” meaning that lighttpd is not in the stock CentOS 7 repos. You have to reach out to EPEL to get it.)
This is not to say that different web servers don’t have advantages even in the CGI case. I run nginx in one extra-small VPS because I don’t have the RAM to run Apache. I couldn’t put enough load on that server to tell any speed difference between Apache and nginx without running it out of CPU or network bandwidth first.
it can be difficult to run systems using ancient software.
“You keep using that word. I do not think it means what you think it does.”
— Inigo Montoya