Sometimes when there's higher traffic on my website, the server randomly stops doing anything and sends 500/503 errors for a few seconds or even minutes.
The Error log shows the following message whenever someone tries to open the website and receives a 500/503-error:
mod_fcgid: can't apply process slot for /var/www/cgi-bin/cgi_wrapper/cgi_wrapper
mod_fcgid configurations:
<IfModule mod_fcgid.c>
FcgidMaxRequestLen 67108864
<IfModule !mod_fastcgi.c>
AddHandler fcgid-script fcg fcgi fpl
</IfModule>
FcgidIPCDir /var/lib/apache2/fcgid/sock
FcgidProcessTableFile /var/lib/apache2/fcgid/shm
FcgidIdleTimeout 40
FcgidProcessLifeTime 30
FcgidMaxProcesses 20
FcgidMaxProcessesPerClass 8
FcgidMinProcessesPerClass 0
FcgidConnectTimeout 30
FcgidIOTimeout 45
FcgidInitialEnv RAILS_ENV production
FcgidIdleScanInterval 10
</IfModule>