Author |
|
maskego
Joined: 16 Apr 2010 Posts: 238
|
Posted: Tue 01 Nov '11 3:06 Post subject: apache memory consumption? |
|
|
I use mod_fcgid to run php.But,I get confused about mod_prefork_mpm.The issue is if I use mod_fcgid,should I use mod_mpm?
Can I disable mod_prefork_mpm to make apache memory consumption less?
what number should I set about the maxrequestsperchild to keep apache service running not crashed?Zero or 1000?(I set it to zero now)
I see this article too.
http://www.apachelounge.com/viewtopic.php?t=3089
Is there any good idea to find what is the reason to lead apache to consume memory?
I make a test.If I find a page to press F5 constantly,the apache occupied memory become high and high,not to become down anymore till restart apache. |
|
Back to top |
|
Kanashii
Joined: 17 Jul 2006 Posts: 155 Location: Porando
|
Posted: Tue 01 Nov '11 5:53 Post subject: |
|
|
Can I disable mod_prefork_mpm to make apache memory consumption less cv ?
mod_prefork_mpm -- you cannot disabled this is part of core
What you mean high 500Mb 1Gb ?
You use mod_mem_cache or mod_disk_cache ?
Last edited by Kanashii on Tue 27 Dec '11 6:16; edited 1 time in total |
|
Back to top |
|
James Blond Moderator
Joined: 19 Jan 2006 Posts: 7373 Location: Germany, Next to Hamburg
|
Posted: Tue 01 Nov '11 7:49 Post subject: |
|
|
Well worker-mpm works fine with mod fcgid. But the question is why your apache is consuming so "much" memory if you already using mod_fcgid? Serving so much pages or static content? |
|
Back to top |
|
maskego
Joined: 16 Apr 2010 Posts: 238
|
Posted: Tue 01 Nov '11 9:20 Post subject: |
|
|
That's my apache question.
The memory consumed by apache is between 400MB~600MB during 5 hours.
I don't know why.There are no many visitors and much static contents.
And,I don't use mod_mem_cache or mod_disk_cache.
Is there any good idea to make momory released after apache runs services? |
|
Back to top |
|
James Blond Moderator
Joined: 19 Jan 2006 Posts: 7373 Location: Germany, Next to Hamburg
|
Posted: Tue 01 Nov '11 18:32 Post subject: |
|
|
Yepp there is a way. In some older days I had such a problem, too. The machine run full.
Well the short solution is to restart apache graceful via cron job. But that is not an end solution.
You may post your config. So I might see which values to adjust. mpm config shall be enough. Also good to know would be the loaded modules.
--edit ---
Forgot: How many requests does the server serv per second? Many visitors?
Sendfile already disabled? |
|
Back to top |
|
maskego
Joined: 16 Apr 2010 Posts: 238
|
Posted: Wed 02 Nov '11 4:17 Post subject: |
|
|
james:
Maybe it's a way to check what config will cause apache start memory grows more and more.
commonly site's visitors will not cause heavy loading.That's why I can't configure. |
|
Back to top |
|
maskego
Joined: 16 Apr 2010 Posts: 238
|
Posted: Fri 04 Nov '11 4:57 Post subject: |
|
|
An error message shows:
failed httpd.exe,ver. 2.2.21.0,failed module ntdll.dll,ver. 5.2.3790.4789,address 0x0004cd02。
Is this be hacked or not?
or it's an apache vulnerability? |
|
Back to top |
|
Kanashii
Joined: 17 Jul 2006 Posts: 155 Location: Porando
|
Posted: Fri 04 Nov '11 17:17 Post subject: |
|
|
had you install all Service Packs and updates ? |
|
Back to top |
|
James Blond Moderator
Joined: 19 Jan 2006 Posts: 7373 Location: Germany, Next to Hamburg
|
Posted: Fri 04 Nov '11 18:12 Post subject: |
|
|
maskego wrote: | An error message shows:
failed httpd.exe,ver. 2.2.21.0,failed module ntdll.dll,ver. 5.2.3790.4789,address 0x0004cd02。
Is this be hacked or not?
or it's an apache vulnerability? |
wait! Now I'm totaly confused. We talked about prefork and worker mpm. And now there is httpd.exe and ntdll.dll. Something does not fit. prefork mpm and worker mpm belong into linux / unix world while httpd.exe and ntdll.dll are windows stuff. What are we talking about? What is your OS? |
|
Back to top |
|
maskego
Joined: 16 Apr 2010 Posts: 238
|
Posted: Sat 05 Nov '11 2:55 Post subject: |
|
|
It's a hard stuff of tunning apache running and memory.After I try hard to reduce apache memory consumption,one error occurs as what I mentioned before.
What can I do about apache?
MY OS is 2003 server std.
I install service pack and all microsoft updates.
And,I check the prefork mpm setting,I find it's the deault value that I don't change it. |
|
Back to top |
|
James Blond Moderator
Joined: 19 Jan 2006 Posts: 7373 Location: Germany, Next to Hamburg
|
Posted: Sat 05 Nov '11 8:14 Post subject: |
|
|
If you are include conf/extra/httpd-mpm.conf there is a part with mpm_winnt_module. For windows there is only winnt mpm Did you change any of this values? I guess you only load the modules you really need? You run any 3rd party module like php, perl or python? |
|
Back to top |
|
Steffen Moderator
Joined: 15 Oct 2005 Posts: 3092 Location: Hilversum, NL, EU
|
Posted: Sat 05 Nov '11 11:37 Post subject: |
|
|
Indeed only load Apache (third party) modules and e.g. PHP extensions you really need.
Want to add that it is reported that mod_security-2.6.1 had a memory leak. Mod-security has also nowadays quite a lot rules which has of course impact on memory and CPU. Using here a minimum set of rules which fits my needs.
Steffen |
|
Back to top |
|
maskego
Joined: 16 Apr 2010 Posts: 238
|
Posted: Sun 06 Nov '11 2:18 Post subject: |
|
|
@james:I just use mod_fcgid to run php scripts only.No any php extensions except default.No third party modules.I just run php on my site.I keep the default values as possible.
@steffen:Maybe you are right.I find mod_security consume much memory,it causes momory leakage even.I upgrade to mod_security to 2.6.2.But,I turn off the modsecurity to test,the memory is growing after press F5 constantly.I feel I am a fool about apache. |
|
Back to top |
|
James Blond Moderator
Joined: 19 Jan 2006 Posts: 7373 Location: Germany, Next to Hamburg
|
Posted: Sun 06 Nov '11 5:17 Post subject: |
|
|
Does the memory usage happen only on php pages or also on static content? |
|
Back to top |
|
maskego
Joined: 16 Apr 2010 Posts: 238
|
Posted: Sun 06 Nov '11 7:51 Post subject: |
|
|
Memory consumption happens at static content also.But,the static content consumes less than php scripts.
James Blond wrote: | Does the memory usage happen only on php pages or also on static content? |
|
|
Back to top |
|
Steffen Moderator
Joined: 15 Oct 2005 Posts: 3092 Location: Hilversum, NL, EU
|
Posted: Sun 06 Nov '11 11:56 Post subject: |
|
|
@maskego
Maybe an idea that you post all your loaded Apache modules and php extensions. Best not to touch mpm settings and forget for windows the prefork stuff.
Steffen |
|
Back to top |
|
maskego
Joined: 16 Apr 2010 Posts: 238
|
Posted: Tue 08 Nov '11 1:43 Post subject: |
|
|
@staffen:
What I used extensoions at apache and php below.
Code: |
antiloris_modulemodules/mod_antiloris.so
security2_modulemodules/mod_security2/mod_security2.so
actions_modulemodules/mod_actions.so
alias_modulemodules/mod_alias.so
asis_modulemodules/mod_asis.so
auth_basic_modulemodules/mod_auth_basic.so
authn_default_modulemodules/mod_authn_default.so
authn_file_modulemodules/mod_authn_file.so
authz_default_modulemodules/mod_authz_default.so
authz_groupfile_modulemodules/mod_authz_groupfile.so
authz_host_modulemodules/mod_authz_host.so
authz_user_modulemodules/mod_authz_user.so
autoindex_modulemodules/mod_autoindex.so
deflate_modulemodules/mod_deflate.so
dir_modulemodules/mod_dir.so
env_modulemodules/mod_env.so
fcgid_modulemodules/mod_fcgid.so
headers_modulemodules/mod_headers.so
imagemap_modulemodules/mod_imagemap.so
include_modulemodules/mod_include.so
isapi_modulemodules/mod_isapi.so
log_config_modulemodules/mod_log_config.so
mime_modulemodules/mod_mime.so
negotiation_modulemodules/mod_negotiation.so
rewrite_modulemodules/mod_rewrite.so
setenvif_modulemodules/mod_setenvif.so
unique_id_modulemodules/mod_unique_id.so
userdir_modulemodules/mod_userdir.so
extension=php_curl.dll
extension=php_mbstring.dll
extension=php_exif.dll
extension=php_gd2.dll
extension=php_mysql.dll
extension=php_mysqli.dll
extension=php_pdo.dll
extension=php_pdo_sqlite.dll
extension=php_sockets.dll
extension=php_sqlite.dll |
|
|
Back to top |
|
Steffen Moderator
Joined: 15 Oct 2005 Posts: 3092 Location: Hilversum, NL, EU
|
Posted: Tue 08 Nov '11 12:41 Post subject: |
|
|
I should try to run without mod_security and antiloris, to see if it helps.
And try:
Win32DisableAcceptEx
EnableSendfile Off
EnableMMAP off
ThreadsPerChild 250
MaxRequestsPerChild 0
What happens when you disable mod_fcgid ?
For the php extensions, maybe James Blond (mario) can advise.
Steffen |
|
Back to top |
|
maskego
Joined: 16 Apr 2010 Posts: 238
|
Posted: Wed 09 Nov '11 2:54 Post subject: |
|
|
@steffen:
If turn off mod_fcgid,the php scripts will show plainful.After press F5 constantly,the apache memory consumption is growing.
Steffen wrote: |
What happens when you disable mod_fcgid ?
Steffen |
|
|
Back to top |
|
Steffen Moderator
Joined: 15 Oct 2005 Posts: 3092 Location: Hilversum, NL, EU
|
Posted: Wed 09 Nov '11 11:37 Post subject: |
|
|
With how many memory does httpd.exe starts and how ends it ?
You did not try the other things I advised ?
You can also try to install Apache plain and use the standard settings.
Steffen |
|
Back to top |
|