Author |
|
maskego
Joined: 16 Apr 2010 Posts: 238
|
Posted: Tue 05 Jul '11 10:09 Post subject: Can it set apache auto restart at win 32? |
|
|
Can it set apache auto restart at win 32 task schedule?Will apache crash when set apache to restart schedule?
Is it a good idea to release memory consumption? |
|
Back to top |
|
James Blond Moderator
Joined: 19 Jan 2006 Posts: 7371 Location: Germany, Next to Hamburg
|
Posted: Tue 05 Jul '11 10:24 Post subject: |
|
|
Well there are some more options.
You could limit the requests and apache will restart itself after the number of requests you defined. By default apache servs unlimited requests MaxRequestsPerChild.
Another option is to use the task schedule if you have installed apache as service.
The much better option is to search what causes the huge memory usage. All other stuff is only fighting the symptoms.
How much memory does your apache consume? |
|
Back to top |
|
maskego
Joined: 16 Apr 2010 Posts: 238
|
Posted: Tue 05 Jul '11 10:59 Post subject: |
|
|
There are two httpd.exe precessions to run.
one is 700MB(max)-->increasing more and more.
one is 200MB(max)-->fixed value.
I install mod_fcgid too.The memory consumption is high still.
I try hard to find the clues,but can't find it as yet.
James Blond wrote: | Well there are some more options.
You could limit the requests and apache will restart itself after the number of requests you defined. By default apache servs unlimited requests MaxRequestsPerChild.
Another option is to use the task schedule if you have installed apache as service.
The much better option is to search what causes the huge memory usage. All other stuff is only fighting the symptoms.
How much memory does your apache consume? |
Last edited by maskego on Wed 06 Jul '11 1:59; edited 1 time in total |
|
Back to top |
|
James Blond Moderator
Joined: 19 Jan 2006 Posts: 7371 Location: Germany, Next to Hamburg
|
Posted: Tue 05 Jul '11 11:29 Post subject: |
|
|
That there are two processes is ok. Parent process I think it is the one with the lower usage. The other one is the child process which handles the requests.
Did you install mod_fcgid parallel to mod_php? Tried to disable mod_php?
To which number did you set ThreadsPerChild? |
|
Back to top |
|
maskego
Joined: 16 Apr 2010 Posts: 238
|
Posted: Wed 06 Jul '11 1:59 Post subject: |
|
|
James:
the ThreadsPerChild is 250 by default.Is it a safe setting?
And,I install mpm for NT too.Does it need to disable?
another,will the mod_fcgid help to release memory when the threads is timeout?
James Blond wrote: | That there are two processes is ok. Parent process I think it is the one with the lower usage. The other one is the child process which handles the requests.
Did you install mod_fcgid parallel to mod_php? Tried to disable mod_php?
To which number did you set ThreadsPerChild? |
|
|
Back to top |
|
maskego
Joined: 16 Apr 2010 Posts: 238
|
Posted: Wed 06 Jul '11 3:25 Post subject: |
|
|
And,what is the way to disable mod_php completely?
Maybe it's a key way to cause memory high consumption due to enable mod_php parallelly.But,I can't find the way to disable that. |
|
Back to top |
|
James Blond Moderator
Joined: 19 Jan 2006 Posts: 7371 Location: Germany, Next to Hamburg
|
Posted: Wed 06 Jul '11 10:07 Post subject: |
|
|
Comment out the php module
Code: |
#LoadModule php5_module "c:/php5/php5apache2_2.dll"
#AddHandler application/x-httpd-php .php
|
|
|
Back to top |
|
maskego
Joined: 16 Apr 2010 Posts: 238
|
Posted: Wed 06 Jul '11 10:22 Post subject: |
|
|
It can't comment.After comment this: Code: | #LoadModule php5_module "c:/php5/php5apache2_2.dll" |
Or it appears "Additionally, a 403 Forbidden error was encountered while trying to use an ErrorDocument to handle the request "error message.
But,I have installed mod_fcgid .
Code: | [Wed Jul 06 16:27:48 2011] [notice] Apache/2.2.19 (Win32) mod_fcgid/2.3.6 configured |
How to fix it?Please help soon.
James Blond wrote: | Comment out the php module
Code: |
#LoadModule php5_module "c:/php5/php5apache2_2.dll"
#AddHandler application/x-httpd-php .php
|
| |
|
Back to top |
|
James Blond Moderator
Joined: 19 Jan 2006 Posts: 7371 Location: Germany, Next to Hamburg
|
Posted: Wed 06 Jul '11 17:05 Post subject: |
|
|
What is in your error log and your access log about the 403?
How is the config of your fcgid? |
|
Back to top |
|
Kanashii
Joined: 17 Jul 2006 Posts: 155 Location: Porando
|
Posted: Thu 07 Jul '11 18:06 Post subject: |
|
|
I writer long time ego
http://www.apachelounge.com/viewtopic.php?t=3674
and
Autorestart.bat
@echo off
:loop
timeout /t 3600 /nobreak
REM #> NUL
echo .
TASKKILL /F /IM php-cgi.exe
%PATH_TO_HTTPD%\httpd -n Apache -k stop
TASKKILL /F /IM httpd.exe
%PATH_TO_HTTPD%\httpd -n Apache -k start
ping 127.0.0.1 -n 3
goto loop |
|
Back to top |
|
James Blond Moderator
Joined: 19 Jan 2006 Posts: 7371 Location: Germany, Next to Hamburg
|
Posted: Thu 07 Jul '11 20:52 Post subject: |
|
|
Still a nice script! I think you should / can also delete the pid file from apache before starting to avoid some warnings in the error log. Just my 2 cents. |
|
Back to top |
|
maskego
Joined: 16 Apr 2010 Posts: 238
|
Posted: Fri 08 Jul '11 3:58 Post subject: |
|
|
I solve it.
It's hard to install mod_fcgid2.3.6.
It can't run at old apache 2.2.x ver.And,it needs new version of php5.x.
James Blond wrote: | What is in your error log and your access log about the 403?
How is the config of your fcgid? |
|
|
Back to top |
|
maskego
Joined: 16 Apr 2010 Posts: 238
|
Posted: Fri 08 Jul '11 3:59 Post subject: |
|
|
And,can you provide the fully autorestart batch file?
regards
James Blond wrote: | Still a nice script! I think you should / can also delete the pid file from apache before starting to avoid some warnings in the error log. Just my 2 cents. |
|
|
Back to top |
|
James Blond Moderator
Joined: 19 Jan 2006 Posts: 7371 Location: Germany, Next to Hamburg
|
Posted: Fri 08 Jul '11 10:21 Post subject: |
|
|
@echo off
:loop
timeout /t 3600 /nobreak
REM #> NUL
echo .
TASKKILL /F /IM php-cgi.exe
%PATH_TO_HTTPD%\httpd -n Apache -k stop
TASKKILL /F /IM httpd.exe
del C:\apache22\logs\httpd.pid
%PATH_TO_HTTPD%\httpd -n Apache -k start
ping 127.0.0.1 -n 3 |
|
Back to top |
|