logo
Apache Lounge
Webmasters

 

About Forum Index Downloads Search Register Log in RSS X


Keep Server Online

If you find the Apache Lounge, the downloads and overall help useful, please express your satisfaction with a donation.

or

Bitcoin

A donation makes a contribution towards the costs, the time and effort that's going in this site and building.

Thank You! Steffen

Your donations will help to keep this site alive and well, and continuing building binaries. Apache Lounge is not sponsored.
Post new topic   Forum Index -> Apache View previous topic :: View next topic
Reply to topic   Topic: Apache Catch-22 problem
Author
notaloafer



Joined: 31 May 2007
Posts: 17
Location: Anacortes

PostPosted: Thu 31 May '07 8:53    Post subject: Apache Catch-22 problem Reply with quote

Basically I'm running on a Windows OS.

the Issue: if I disable the AcceptEx in Apache2, I generate a massive error log of issues with it and I also believe that it has a negative impact on the server's speed to serve web documents.

If I do enable AcceptEx in the configuration file, Apache uses up all of my RAM without renewing any of it within 1 day and then crashes and goes into this cycle.

Is there any way to fix this? I've looked everywhere out there and can't seem to find any support on it!

Thanks!
-Eric.
Back to top
Bruce



Joined: 28 Nov 2006
Posts: 77
Location: Mars

PostPosted: Fri 01 Jun '07 10:33    Post subject: Reply with quote

check your httpd.conf for lemmap and and try
#EnableMMAP off
#EnableSendfile off
as for disable EcceptEX I use that the only errors I get are in my windows event logs and just disregard the errors its only logging the notice
Back to top
bokehman



Joined: 12 Oct 2006
Posts: 11

PostPosted: Fri 01 Jun '07 22:18    Post subject: Reply with quote

ThreadsPerChild 20
MaxRequestsPerChild 100
Back to top
notaloafer



Joined: 31 May 2007
Posts: 17
Location: Anacortes

PostPosted: Thu 21 Jun '07 8:00    Post subject: Reply with quote

Well I'm still having this issue. except now I added a new piece to the puzzle:

When I have Win32DisableAcceptEx disabled the following happens:
1) Whenever I use any type of forum software, the auto-login feature refuses to work and in all of the logs of the phpbb forums I get IP addresses showing as 0.0.0.0 .
2) Massive log creation with AcceptEx failures.

When I have Win32DisableAcceptEx enabled the following happens:
1) Massive Apache memory usage which eventually leads up to a httpd.exe crash and apache restart (happens several times per day).
2) EXTREMELY slow page loads.
3) PHP Out of Memory errors (cannot allot xxx bytes)

I really don't know what to do guys, I've looked everywhere with people having issues with it and there have been no solutions to it (from what I can see). I also have tried completely stopping all services, uninstalling all anti-virus and firewalls, etc. to no avail (while having Win32DisableAcceptEx disabled to see if the IP will fix).

Any help is greatly appreciated!
I'm running Windows 2000 Professional with ZoneAlarm Pro & AVG Anti-Virus with Apache 2.2.4 and PHP 5.2.1

Thanks
-Eric.

PS- Would a option be to downgrade Apache/PHP versions? I know when I used to run a server with older versions I did not have this problem!
Back to top
tdonovan
Moderator


Joined: 17 Dec 2005
Posts: 611
Location: Milford, MA, USA

PostPosted: Fri 22 Jun '07 5:32    Post subject: Reply with quote

The IP address 0.0.0.0 problem is a known Apache 2.2.4 bug with Windows 2000 (Windows 2000 only - it doesn't affect Windows 2003, WinXP or Vista).
It's fixed for the next Apache release, but until then you will want to put Win32DisableAcceptEx in your config for Windows 2000.

All the other symptoms (AcceptEx failures, memory use, slow response, PHP out-of-memory) are not common problems with Apache 2.2.4 on Windows 2000, AFAIK.

It is especially curious that you have "Massive log creation with AcceptEx failures" when you use the Win32DisableAcceptEx directive.
This directive should prevent Apache from using the Windows AcceptEx function, and force Apache to use a plain accept function instead.

Possibly you have a problem with your network card or its driver which is stalling responses, while still allowing requests to come in (...and pile up...)

One test would be to try a request which gives a slow response (i.e. 10 seconds or so) and note the precise system time on your server when you make it.
Then look in your access.log file and see if the Apache timestamp is within a second of entering the request, or if the timestamp is at the end of the 10-second pause.

If Apache reports that it completed the request at (almost) the same moment you entered it - then your problem may be a network problem which is "downstream" from Apache.

It would also be good to try removing ZoneAlarm and AVG with Win32DisableAcceptEx in your config, not just without it.

re: "I also believe that it has a negative impact on the server's speed"
I need to use Win32DisableAcceptEx with Apache 2.2.4 on my Windows 2000 SP4 system and I find it does have a very small performance impact.
The increase in response-time is much less than 1% in the worst case (many small static files), so it's really not a problem.

-tom-
Back to top
notaloafer



Joined: 31 May 2007
Posts: 17
Location: Anacortes

PostPosted: Fri 22 Jun '07 7:09    Post subject: Reply with quote

tdonovan wrote:


It is especially curious that you have "Massive log creation with AcceptEx failures" when you use the Win32DisableAcceptEx directive.
This directive should prevent Apache from using the Windows

-tom-


When I use the AcceptEx Disable function the logs don't build up, (you may have misread my previous post Razz but its all cool).

The strange thing about the AcceptEx thing is when I have AcceptExDisable in the config, the IP addresses show up (they show as they should) however when I have AcceptExDisable removed from the config file, all IP's show as 0.0.0.0

my question is how does the AcceptEx relate to IP addresses showing up right or wrong? I would just ignore the AcceptEx issue, but none of my forum stuff is working right without ip resolution.

thanks
-eric
Back to top
tdonovan
Moderator


Joined: 17 Dec 2005
Posts: 611
Location: Milford, MA, USA

PostPosted: Fri 22 Jun '07 13:35    Post subject: Reply with quote

re: "you may have misread my previous post"

Yes, you're right - I had it backwards...

re: "my question is how does the AcceptEx relate to IP addresses showing up right or wrong?"

This is explained a bit in the Apache 2.2.4 bug at http://issues.apache.org/bugzilla/show_bug.cgi?id=41321

Changes in socket handling for Apache 2.2.4 exposed an underlying Windows 2000 bug.

-tom-
Back to top
notaloafer



Joined: 31 May 2007
Posts: 17
Location: Anacortes

PostPosted: Fri 22 Jun '07 18:04    Post subject: Reply with quote

So as-of now if I use "Win32AcceptExDisable" is there any way to keep Apache from using up all of my RAM and stop it from generating PHP Out of memory errors? Maybe these two aren't related, but I need to fix this problem nevertheless.

Basically if I can fix this issue, I'm fine with having Win32AcceptExDisable in my config file (until the next apache comes out with the fix).

Thanks so much
-Eric.

ALSO- If this can't be fixed, do you think downgrading to Apache 2.0.x would be worth it or would it be a big security risk?
Back to top
Steffen
Moderator


Joined: 15 Oct 2005
Posts: 3057
Location: Hilversum, NL, EU

PostPosted: Fri 22 Jun '07 20:36    Post subject: Reply with quote

PHP is mostly bloating the server and eating memory in time.
You can try FASTCGI, see a former post from me:

I am running php as Fastcgi here at the Apache Lounge and the memory usage of httpd.exe is now after some time ~100M and two php precesses of ~10M each, when I runned php as module it was far over 400M.

So running as Fastcgi memory usage of Apache is far less en the Speed is on par when running as module. There are advantages to running PHP with FCGI. Separating the PHP code from the web server removes 'bloat' from the main server, and improves the performance of non-PHP requests. Secondly, having one permanent PHP process as opposed to one per apache process means that shared resources like persistent MySQL connections are used more efficiently. And maybe even more important is stability, since I run FCGI my server never crashed caused by php (extension) errors.


Steffen
Back to top
notaloafer



Joined: 31 May 2007
Posts: 17
Location: Anacortes

PostPosted: Sat 23 Jun '07 2:11    Post subject: Reply with quote

If I run PHP as a module will this still work? it sounds to me like your PHP is running in a seperate process (unless this is what FastCGI does)

Sorry if that sounds stupid, but I've never heard of FastCGI before!

Thanks
-Eric.

Is there any alternative besides using FastCGI? Their documentation on their website is really horrible.
Back to top
Steffen
Moderator


Joined: 15 Oct 2005
Posts: 3057
Location: Hilversum, NL, EU

PostPosted: Sat 23 Jun '07 11:47    Post subject: Reply with quote

Search for mod_fcgid here and you find some posts about Fastcgi.

The home of mod_fcgid is http://fastcgi.coremail.cn/

Steffen
Back to top
notaloafer



Joined: 31 May 2007
Posts: 17
Location: Anacortes

PostPosted: Sat 23 Jun '07 19:15    Post subject: Reply with quote

Hey I'm going to give this FCGID mod a try and see how it goes. Otherwise do you mind helping me configure my server? I have VNC, etc. and I noticed on your guys' download page you said that you help free of charge.

Thanks!
-Eric.
Back to top
notaloafer



Joined: 31 May 2007
Posts: 17
Location: Anacortes

PostPosted: Sat 23 Jun '07 19:32    Post subject: Reply with quote

Ok I've installed mod_fcgid.so and I have successfully loaded it with Apache (on a restart). I'm not quite sure on the configuration of it. I looked on http://fastcgi.coremail.cn/configuration.htm#PHP-Windows and here's what it says to do (I'm confused about all of this Razz)

Quote:


This is for fastcgi-mode PHP ( Windows )

LoadModule fcgid_module modules/mod_fcgid.so
DefaultInitEnv PHPRC "c:/php/"
DefaultInitEnv PATH "c:/php;C:/WINDOWS/system32;C:/WINDOWS;C:/WINDOWS/System32/Wbem;"
DefaultInitEnv SystemRoot "C:/Windows"
DefaultInitEnv SystemDrive "C:"
DefaultInitEnv TEMP "C:/WINDOWS/TEMP"
DefaultInitEnv TMP "C:/WINDOWS/TEMP"
DefaultInitEnv windir "C:/WINDOWS"
<Directory "C:/Apache2/htdocs/php/">
SetHandler fcgid-script
Options execCGI
AllowOverride None
Order allow,deny
Allow from all
FCGIWrapper "c:/php/php.exe" .php

# You need mod_fcgid version >= 2.1 to support arguments in FCGIWrapper, if you want
# FCGIWrapper "/usr/local/bin/php -c /etc/" .php
</Directory>

This works too:

LoadModule fcgid_module modules/mod_fcgid.so
DefaultInitEnv PHPRC "c:/php/"
DefaultInitEnv PATH "c:/php;C:/WINDOWS/system32;C:/WINDOWS;C:/WINDOWS/System32/Wbem;"
DefaultInitEnv SystemRoot "C:/Windows"
DefaultInitEnv SystemDrive "C:"
DefaultInitEnv TEMP "C:/WINDOWS/TEMP"
DefaultInitEnv TMP "C:/WINDOWS/TEMP"
DefaultInitEnv windir "C:/WINDOWS"
AddHandler fcgid-script .php
<Directory "C:/Apache2/htdocs/php/">
FCGIWrapper "c:/php/php.exe" .php

# You need mod_fcgid version >= 2.1 to support arguments in FCGIWrapper, if you want
# FCGIWrapper "/usr/local/bin/php -c /etc/" .php

Options ExecCGI
allow from all
</Directory>

This is for Authenticator

LoadModule fcgid_module modules/mod_fcgid.so

<Location /fcgid>
SetHandler fcgid-script
Options ExecCGI
allow from all
AuthType Basic
AuthName ProtectedRealm
FastCgiAuthenticator /some/path/authenticator
require valid-user
</Location>

Another configuration: FastCgiAuthenticatorAuthoritative (default On)

Setting the FastCgiAuthenticatorAuthoritative directive explicitly to Off allows authentication to be passed on to lower level modules

This is for Authorizer

LoadModule fcgid_module modules/mod_fcgid.so

<Location /fcgid>
SetHandler fcgid-script
Options ExecCGI
allow from all
AuthType Basic
AuthName ProtectedRealm
FastCgiAuthorizer /some/place/Authorizer
</Location>

Another configuration: FastCgiAuthorizerAuthoritative (default On)

Setting the FastCgiAuthorizerAuthoritative directive explicitly to Off allows authorization to be passed on to lower level modules

This is for AccessChecker

LoadModule fcgid_module modules/mod_fcgid.so

<Location /fcgid>
SetHandler fcgid-script
Options ExecCGI
allow from all
FastCgiAccessChecker /some/place/access-checker
</Location>

Another configuration: FastCgiAccessCheckerAuthoritative (default On)

Setting the FastCgiAccessCheckerAuthoritative directive explicitly to Off allows access checking to be passed on to lower level modules

Back to top
notaloafer



Joined: 31 May 2007
Posts: 17
Location: Anacortes

PostPosted: Sun 24 Jun '07 1:53    Post subject: Reply with quote

Update: When I use the default options for the new module I installed, it crashes even more oftin than it did without it. What shall I do?
Back to top
notaloafer



Joined: 31 May 2007
Posts: 17
Location: Anacortes

PostPosted: Mon 25 Jun '07 2:42    Post subject: Reply with quote

Another Update:

I started messing with php memory_limit (with Win32AcceptEx disabled) and my memory usage for the Apache process is way down (when I set the memory usage in php way lower). I also started loading standard html pages and there was no memory increase at all. This must mean that PHP is causing the problem with high httpd.exe memory usage. any new ideas? It seems now that I need to find a fix for PHP.

-Eric.
Back to top


Reply to topic   Topic: Apache Catch-22 problem View previous topic :: View next topic
Post new topic   Forum Index -> Apache