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: Can it set apache auto restart at win 32?
Author
maskego



Joined: 16 Apr 2010
Posts: 238

PostPosted: Tue 05 Jul '11 10:09    Post subject: Can it set apache auto restart at win 32? Reply with quote

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? Rolling Eyes
Back to top
James Blond
Moderator


Joined: 19 Jan 2006
Posts: 7371
Location: Germany, Next to Hamburg

PostPosted: Tue 05 Jul '11 10:24    Post subject: Reply with quote

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

PostPosted: Tue 05 Jul '11 10:59    Post subject: Reply with quote

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

PostPosted: Tue 05 Jul '11 11:29    Post subject: Reply with quote

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

PostPosted: Wed 06 Jul '11 1:59    Post subject: Reply with quote

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

PostPosted: Wed 06 Jul '11 3:25    Post subject: Reply with quote

And,what is the way to disable mod_php completely? Smile

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. Crying or Very sad
Back to top
James Blond
Moderator


Joined: 19 Jan 2006
Posts: 7371
Location: Germany, Next to Hamburg

PostPosted: Wed 06 Jul '11 10:07    Post subject: Reply with quote

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

PostPosted: Wed 06 Jul '11 10:22    Post subject: Reply with quote

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. Shocked


James Blond wrote:
Comment out the php module

Code:

#LoadModule php5_module "c:/php5/php5apache2_2.dll"
#AddHandler application/x-httpd-php .php
Shocked Shocked Shocked
Back to top
James Blond
Moderator


Joined: 19 Jan 2006
Posts: 7371
Location: Germany, Next to Hamburg

PostPosted: Wed 06 Jul '11 17:05    Post subject: Reply with quote

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

PostPosted: Thu 07 Jul '11 18:06    Post subject: Reply with quote

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

PostPosted: Thu 07 Jul '11 20:52    Post subject: Reply with quote

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

PostPosted: Fri 08 Jul '11 3:58    Post subject: Reply with quote

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

PostPosted: Fri 08 Jul '11 3:59    Post subject: Reply with quote

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

PostPosted: Fri 08 Jul '11 10:21    Post subject: Reply with quote

@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


Reply to topic   Topic: Can it set apache auto restart at win 32? View previous topic :: View next topic
Post new topic   Forum Index -> Apache