Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The app runs quite slow. Missing perl/apache optimizations. #11

Open
vkhatuwala opened this issue Nov 16, 2022 · 1 comment
Open

The app runs quite slow. Missing perl/apache optimizations. #11

vkhatuwala opened this issue Nov 16, 2022 · 1 comment

Comments

@vkhatuwala
Copy link

Hello,

I find that the app runs quite slow and I think its because the related perl optimizations like mod_perl are not setup correctly. Im not great at perl but, I've tried to install mod_perl and tried to enable in apache but failed with internal server errors.

Installed:
apt-get install -y libapache2-mod-perl2

Added/replaced in /etc/apache2/sites-enabled/gestioip.conf :

<Directory "/var/www/html/gestioip">
....
    AddHandler perl-script .cgi
    PerlResponseHandler ModPerl::Registry
    PerlSendHeader On
....
</Directory>

Error log output:

[Wed Nov 16 04:50:24.927073 2022] [:warn] [pid 234:tid 140140882159360] -T switch is ignored, enable with 'PerlSwitches -T' in httpd.conf\n
[Wed Nov 16 04:50:24.928303 2022] [:error] [pid 234:tid 140140882159360] Can't locate GestioIP.pm in @INC (you may need to install the GestioIP module) (@INC contains: ./modules /etc/perl /usr/local/lib/x86_64-linux-gnu/perl/5.30.0 /usr/local/share/perl/5.30.0 /usr/lib/x86_64-linux-gnu/perl5/5.30 /usr/share/perl5 /usr/lib/x86_64-linux-gnu/perl/5.30 /usr/share/perl/5.30 /usr/local/lib/site_perl /etc/apache2) at /var/www/html/gestioip/index.cgi line 23.\nBEGIN failed--compilation aborted at /var/www/html/gestioip/index.cgi line 23.\n

Please help to fix this performance issue.

Thanks.

@NHellFire
Copy link

You'll need to ensure you're using mpm_prefork, and instead of

PerlResponseHandler ModPerl::Registry

you need to use:

PerlResponseHandler ModPerl::RegistryPrefork

As the code contains relative paths.

https://perl.apache.org/docs/2.0/api/ModPerl/Registry.html#Description

META: document that for now we don't chdir() into the script's dir, because it affects the whole process under threads. ModPerl::RegistryPrefork should be used by those who run only under prefork MPM.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants