Articles in this section

Webmail works extremely slow on Plesk server: mod_fcgid: can't apply process slot for /var/www/cgi-bin/cgi_wrapper/cgi_wrapper

kb: technical Plesk Obsidian for Linux

Symptoms

  • Webmail works extremely slow.

  • The following errors can be found in Apache 2 log file (/var/log/apache2/error.log):

    CONFIG_TEXT: [fcgid:warn] [pid 15866:tid 139793676725184] (11)Resource temporarily unavailable: mod_fcgid: spawn process /var/www/cgi-bin/cgi_wrapper/cgi_wrapper error
    [fcgid:error] [pid 15866:tid 139793676725184] (11)Resource temporarily unavailable: mod_fcgid: can't run /var/www/cgi-bin/cgi_wrapper/cgi_wrapper
    [fcgid:warn] [pid 15866:tid 139793676725184] (11)Resource temporarily unavailable: mod_fcgid: spawn process /var/www/cgi-bin/cgi_wrapper/cgi_wrapper error
    [fcgid:warn] [pid 15867:tid 139793417606912] [client 203.0.113.2:23789] mod_fcgid: can't apply process slot for /var/www/cgi-bin/cgi_wrapper/cgi_wrapper

  • The cgi_wrapper permissions are correct:

    # namei -l /var/www/cgi-bin/cgi_wrapper/cgi_wrapper
    f: /var/www/cgi-bin/cgi_wrapper/cgi_wrapper
    drwxr-xr-x root root /
    drwxr-xr-x root root var
    drwxr-xr-x root root www
    drwxr-xr-x root root cgi-bin
    drwxr-xr-x root root cgi_wrapper
    -rwxr-xr-x root root cgi_wrapper

  • The FcgidMaxProcesses following were adjusted already :

    # grep -irE 'FcgidMaxProcesses|FcgidMaxProcessesPerClass' /etc/apache2/
    /etc/apache2/mods-available/fcgid.conf: FcgidMaxProcesses 300
    /etc/apache2/mods-available/fcgid.conf: FcgidMaxProcessesPerClass 15

Cause

The systemd slice limit for Apache 2 is set to a very low value:

# cat /sys/fs/cgroup/pids/system.slice/apache2.service/pids.{max,current}
60
59

Normally it should be at least 2000 for pids.max

Resolution

1. Using vi (or other editor) open file /etc/systemd/system.conf
2. Uncomment (remove "#") the following line, and set its value to 2000 as follows:

CONFIG_TEXT: DefaultTasksMax=2000

3. Save the file.
4. Restart apache2 web server using the following command:

# systemctl restart apache2

Was this article helpful?

Comments

0 comments

Please sign in to leave a comment.