Current time: 12-24-2024, 05:22 AM Hello There, Guest! (LoginRegister)


Post Reply 
[SOLVED] How to fix 500 errors
Author Message
pl.zenon Offline
Junior Member
*

Posts: 10
Joined: Nov 2008
Reputation: 0
Post: #1
[SOLVED] How to fix 500 errors
See THIS post for solution

-----

Hello,

I installed ispCP Panel and most functions works fine but I have problem with conifguration & optimization fcgi. I have ~200 members online and a lot of them complain, because they're receiving 500 errors.

Could you give me solutions please how to config server with that load for the best performance without tons of errors?


apache2.conf:
Quote:ExtendedStatus On
Timeout 30
KeepAlive Off

<IfModule mpm_prefork_module>
StartServers 5
MinSpareServers 5
MaxSpareServers 10
MaxClients 150
MaxRequestsPerChild 50
</IfModule>

<IfModule mpm_worker_module>
StartServers 5
MaxClients 150
MinSpareThreads 25
MaxSpareThreads 75
ThreadsPerChild 25
MaxRequestsPerChild 50
</IfModule>

HostnameLookups Off

ServerTokens Prod
ServerSignature Off


fastcgi_ispcp.conf
Quote: FastCgiConfig -minProcesses 5 \
-maxProcesses 400 \
-maxClassProcesses 100 \
-multiThreshold 80 \
-killInterval 60 \
-startDelay 5 \
-idle-timeout 30
# -singleThreshold 100 \
# -autoUpdate \
# -pass-header HTTP_AUTHORIZATION


php5-fcgi-starter for site where there are 200 members online

Quote:export PHPRC
PHP_FCGI_CHILDREN=10
export PHP_FCGI_CHILDREN
PHP_FCGI_MAX_REQUESTS=1000
export PHP_FCGI_MAX_REQUESTS

php.ini for this site:
Quote:output_buffering = Off
zlib.output_compression = On
safe_mode = Off
disable_functions = show_source, system, shell_exec, passthru, exec, phpinfo, shell, symlink, popen, proc_open

max_execution_time = 30 ; Maximum execution time of each script, in seconds
max_input_time = 60 ; Maximum amount of time each script may spend parsing request data
;max_input_nesting_level = 64 ; Maximum input variable nesting level
memory_limit = 128M ; Maximum amount of memory a script may consume (128MB)

display_errors = Off
log_errors = On


Software versions:

Apache 2.2.3
PHP 5.2.0-8+etch13

Thank you very much for any help...
(This post was last modified: 11-15-2008 09:44 AM by pl.zenon.)
11-05-2008 01:32 PM
Find all posts by this user Quote this message in a reply
pgentoo Offline
Member
*****
Dev Team

Posts: 326
Joined: Mar 2007
Reputation: 0
Post: #2
RE: Server configuration request
(11-05-2008 01:32 PM)pl.zenon Wrote:  Could you give me solutions please how to config server with that load for the best performance without tons of errors?

What apache2 MPM are you using? I would suggest using the worker MPM if you aren't already. Prefork brings in a lot of extra overhead.

How often are the 500's occuring? If you have extra RAM, you might want to try increasing the PHP_FCGI_CHILDREN, and even the PHP_FCGI_MAX_REQUESTS if your site is running solid otherwise. This will give more php processes to handle the requests, and hopefully speed things up and eliminate some of the 500's.

It would help if you posted this extra info, along with the frequency this is occuring, and the log entries to try to isolate what is the cause. Also, how is the server load, free memory, etc?

-
pgentoo
Also, maybe make sure you are using the latest fastcgi available, and try to upgrade your php to 5.2.6 (current stable release). There could be some issues in your older version...

-
pgentoo
(This post was last modified: 11-05-2008 03:43 PM by pgentoo.)
11-05-2008 03:41 PM
Find all posts by this user Quote this message in a reply
BeNe Offline
Moderator
*****
Moderators

Posts: 5,899
Joined: Jan 2007
Reputation: 68
Post: #3
RE: Server configuration request
Which ispCP Version Do you have ?
In the current Nightly we changed the Logging system. After that the Server runs much better. Also a swtich so fcgid instead of fastcgi tuned a bit.

Greez BeNe
11-05-2008 05:42 PM
Visit this user's website Find all posts by this user Quote this message in a reply
pl.zenon Offline
Junior Member
*

Posts: 10
Joined: Nov 2008
Reputation: 0
Post: #4
RE: Server configuration request
Hello,

I have ispCP Omega 1.0.0 RC6, I didn't install iscp from Daily Snapshots.
Bene, how can I use current Nightly?

pgentoo, when users receive 500 error, in log appears:

Quote:[Wed Nov 05 08:38:15 2008] [error] [client x] (4)Interrupted system call: FastCGI: comm with server "/var/www/fcgi/x/php5-fcgi-starter" aborted: select() failed, referer: x
[Wed Nov 05 08:38:15 2008] [error] [client x] FastCGI: incomplete headers (0 bytes) received from server "/var/www/fcgi/x/php5-fcgi-starter", referer: x

This error appears very usually, Some (4,5) in 1 minute.

Moreover in error.log there are a lot of:

Quote:terminated by calling exit with status '0'
[Wed Nov 05 06:22:35 2008] [warn] FastCGI: (dynamic) server "/var/www/fcgi/x/php5-fcgi-starter" (pid 9000) termination signaled


When I increase a PHP_FCGI_CHILDREN and PHP_FCGI_MAX_REQUESTS values, there are less 500 errors but after few hours site works slower than before.
(This post was last modified: 11-05-2008 10:31 PM by pl.zenon.)
11-05-2008 10:29 PM
Find all posts by this user Quote this message in a reply
pgentoo Offline
Member
*****
Dev Team

Posts: 326
Joined: Mar 2007
Reputation: 0
Post: #5
RE: Server configuration request
Whats your server load like? Whats your free RAM?
Sorry, accidently posted to early. Smile There were a couple other questions that i asked that you didn't answer. Apache MPM? Can you upgrade to PHP 5.2.6? I know that 30 seconds is a long time for a standard website request, but if you have something really slowing things down, and you are breaking past this timeout, you may need to raise it for the time being. When you are getting HTTP500's, is it after more than 30 seconds, or quicker?

I'm wondering if this is a resource issue, or simply a misconfiguration... As BeNe said, the newer version should run much better. The version you are using creates a TON of file handles to log files, which uses up system resources a lot more than required. mod_fcgid has also been shown to be better than mod_fastcgi. It is what i'm using on my system as well... Maybe look at switching over to get better control over your fcgi processes.

Sorry I can't give a exact answer, there are just too many variables here that could be causing your issues...

-
pgentoo
If raising those 2 values lowered the number of 500's, try leaving the # children a bit higher than you had it before (not too much higher), and leave the max requests number at 1000. If your php processes have a memory leak or something, you want to make sure they get recycled frequently.
(This post was last modified: 11-06-2008 03:19 AM by pgentoo.)
11-06-2008 03:11 AM
Find all posts by this user Quote this message in a reply
pl.zenon Offline
Junior Member
*

Posts: 10
Joined: Nov 2008
Reputation: 0
Post: #6
RE: Server configuration request
Unfortunately I'm using Debian 4.0 and there aren't any new releases of PHP and mod_fastcgi in official Debian repositores. I have E5200 processor with 2GB ram, over 1,5GB free memory now, so I think that 500 isn't a poor server problem.

Sorry, but I don't know what MPM was installed, but probably prefork.

Users receive 500 errors when they'are surfing on my board, entering in topics, writing posts, refreshing shoutbox etc, timeout doesn't cause this errors, I'm sure that.

Moreover I'm not a professional and I fear that when I change mod_fastcgi for mod_fcgid, then server will crash and I can't repair it.
(This post was last modified: 11-06-2008 04:41 AM by pl.zenon.)
11-06-2008 04:40 AM
Find all posts by this user Quote this message in a reply
pgentoo Offline
Member
*****
Dev Team

Posts: 326
Joined: Mar 2007
Reputation: 0
Post: #7
RE: Server configuration request
If you are really running prefork with fastcgi, i would recommend moving over to worker asap. It's much easier on the system, and could relieve some of your issues.

I'd also look for a .deb of php 5.2.6 for your system. I'm sure there are some precompiled ones out there that you can plug in. A bunch of the guys here are debian users, so i'm sure someone will chime in.

Sorry I can't be more help, but I'm not a debian user...
11-06-2008 08:57 AM
Find all posts by this user Quote this message in a reply
pl.zenon Offline
Junior Member
*

Posts: 10
Joined: Nov 2008
Reputation: 0
Post: #8
RE: Server configuration request
Ok, as you wrote, I installed mpm worker instead prefork by:

apt-get install apache2-mpm-worker

Debian installed this package and automatically removed apache2-mpm-prefork. I hope I entered a good command and I didn't make mess in apache?

I read that the newest snapshot of mod_fastcgi particullary repair a incomplete headers problem but I don't know how can I update my mod_fastcgi to this snapshot. Could you tell me how can I do it? I wouldn't like to make mess in my system...
11-07-2008 09:33 AM
Find all posts by this user Quote this message in a reply
pl.zenon Offline
Junior Member
*

Posts: 10
Joined: Nov 2008
Reputation: 0
Post: #9
RE: Server configuration request
I found solution for 500 errors:

We have to download this snapshot:

http://www.fastcgi.com/dist/mod_fastcgi-...952.tar.gz

and compile / install / update it. When we will do it, problem will gone!

During compiling / installing / updating a mod_fastcgi remember about apache2 install dir. Default apache2 install dir isn't proper for Debian and you have to change it in Makefile for /usr/lib/apache2 . If you will not that, you cannot run mod_fastcgi installation. How to install / update mod_fascgi you can find in the middle of the snapshot's archive.

Increasing amount of FCGI Children or other values in fastcfgi configuration doesn't improve anything in case 500 errors.

We can check that by running the apache benchmark.
(This post was last modified: 11-11-2008 04:03 AM by pl.zenon.)
11-11-2008 04:01 AM
Find all posts by this user Quote this message in a reply
smoko Offline


Posts: 2
Joined: Dec 2008
Reputation: 0
Post: #10
RE: [SOLVED] How to fix 500 errors
OR

killall -v php5-cgi
(This post was last modified: 12-27-2008 07:09 AM by smoko.)
12-27-2008 07:08 AM
Find all posts by this user Quote this message in a reply
Post Reply 


Forum Jump:


User(s) browsing this thread: 3 Guest(s)