You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@httpd.apache.org by motty cruz <mo...@gmail.com> on 2013/06/07 21:39:17 UTC
[users@httpd] maximize Apache services
Hello All,
it seems that every time some one like 80legs or any other crawler craws my
website my server goes down. do you k now hot to maximize the number of
child server on Apache to avoid turning off my machine?
my Apache server is running latest Mysql, PHP and Apache22 virtual machine
2028MB of RAM
Thanks in advance
Re: [users@httpd] maximize Apache services
Posted by motty cruz <mo...@gmail.com>.
Thank you very Much Tom,
I was able to re-install Apache22 with MPM option, at this point I am
monitoring the server but thus far is working fine.
Thanks for all your help!
-motty
On Mon, Jun 10, 2013 at 9:52 AM, Tom Evans <te...@googlemail.com> wrote:
> On Mon, Jun 10, 2013 at 5:49 PM, Tom Evans <te...@googlemail.com>
> wrote:
> > 1) run worker or event MPM instead of prefork
>
> And to do so on FreeBSD:
>
> # cd /usr/ports/www/apache22
> # make WITH_MPM=worker clean all deinstall reinstall clean
>
> Cheers
>
> Tom
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
> For additional commands, e-mail: users-help@httpd.apache.org
>
>
Re: [users@httpd] maximize Apache services
Posted by Tom Evans <te...@googlemail.com>.
On Mon, Jun 10, 2013 at 5:49 PM, Tom Evans <te...@googlemail.com> wrote:
> 1) run worker or event MPM instead of prefork
And to do so on FreeBSD:
# cd /usr/ports/www/apache22
# make WITH_MPM=worker clean all deinstall reinstall clean
Cheers
Tom
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org
Re: [users@httpd] maximize Apache services
Posted by Tom Evans <te...@googlemail.com>.
On Mon, Jun 10, 2013 at 3:33 PM, motty cruz <mo...@gmail.com> wrote:
> Hi Mike,
>
> Thanks for your replied; I'm using FreeBSD 9.1, here is the list of modules
>
> Loaded Modules:
> core_module (static)
> mpm_prefork_module (static)
> http_module (static)
> so_module (static)
> authn_file_module (shared)
> authn_anon_module (shared)
> authn_default_module (shared)
> authn_alias_module (shared)
> authz_host_module (shared)
> authz_groupfile_module (shared)
> authz_user_module (shared)
> authz_dbm_module (shared)
> authz_owner_module (shared)
> authz_default_module (shared)
> auth_basic_module (shared)
> auth_digest_module (shared)
> file_cache_module (shared)
> cache_module (shared)
> disk_cache_module (shared)
> dumpio_module (shared)
> reqtimeout_module (shared)
> include_module (shared)
> filter_module (shared)
> charset_lite_module (shared)
> deflate_module (shared)
> log_config_module (shared)
> logio_module (shared)
> env_module (shared)
> mime_magic_module (shared)
> expires_module (shared)
> headers_module (shared)
> usertrack_module (shared)
> unique_id_module (shared)
> setenvif_module (shared)
> version_module (shared)
> mime_module (shared)
> dav_module (shared)
> status_module (shared)
> autoindex_module (shared)
> asis_module (shared)
> info_module (shared)
> cgi_module (shared)
> dav_fs_module (shared)
> vhost_alias_module (shared)
> negotiation_module (shared)
> dir_module (shared)
> imagemap_module (shared)
> actions_module (shared)
> speling_module (shared)
> userdir_module (shared)
> alias_module (shared)
> rewrite_module (shared)
> php5_module (shared)
> Syntax OK
>
1) run worker or event MPM instead of prefork
2) do not use mod_php, use php-fcgi
3) Disable all modules you do not use
At the moment, serving an image/static content to a client is
depriving you of a PHP worker - since each apache child handles only
one request and each apache child has one PHP worker, and therefore
you need more PHP workers to serve your dynamic requests, and
therefore you need more apache children. Since each child can only
serve one request at a time, if that client is slow or blocks, then
the child cannot do anything until it has dealt with its current
request. This means, again, you need more children.
This is inefficient, serving static content is cheap and easy to do.
Using worker means that each child can serve multiple requests at
once, and using php-fcgi means that you can control the number of PHP
workers you have to produce your dynamic pages independently of how
many httpd workers you need.
It also separates the PHP work into a separate process, so you can
clearly see how much memory and CPU PHP uses, compared to apache
httpd.
Cheers
Tom
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org
Re: [users@httpd] maximize Apache services
Posted by Mike Rumph <mi...@oracle.com>.
Hello Motty,
Okay, so you are using the prefork MPM.
I do not have access to a FreeBSD system.
But the performance issues should be similar to Linux.
You could probably see immediate performance improvements by switching
to worker MPM.
- http://httpd.apache.org/docs/2.2/mod/worker.html
The prefork MPM uses only one thread per process.
So it is more demanding on system resources.
The worker MPM allows for multiple threads per child process.
Here is a quote from the above link:
"By using threads to serve requests, it is able to serve a large number
of requests with fewer system resources than a process-based server.
However, it retains much of the stability of a process-based server by
keeping multiple processes available, each with many threads."
The link also lists several directives that can be tinkered with.
To get the worker MPM you would need to use the --with-mpm=worker option
on the configure step.
- http://httpd.apache.org/docs/2.2/mpm.html#choosing
- http://httpd.apache.org/docs/2.2/install.html#configure
I hope this helps.
Thanks,
Mike
On 6/10/2013 7:33 AM, motty cruz wrote:
> Hi Mike,
>
> Thanks for your replied; I'm using FreeBSD 9.1, here is the list of
> modules
>
> Loaded Modules:
> core_module (static)
> mpm_prefork_module (static)
> http_module (static)
> so_module (static)
> authn_file_module (shared)
> authn_anon_module (shared)
> authn_default_module (shared)
> authn_alias_module (shared)
> authz_host_module (shared)
> authz_groupfile_module (shared)
> authz_user_module (shared)
> authz_dbm_module (shared)
> authz_owner_module (shared)
> authz_default_module (shared)
> auth_basic_module (shared)
> auth_digest_module (shared)
> file_cache_module (shared)
> cache_module (shared)
> disk_cache_module (shared)
> dumpio_module (shared)
> reqtimeout_module (shared)
> include_module (shared)
> filter_module (shared)
> charset_lite_module (shared)
> deflate_module (shared)
> log_config_module (shared)
> logio_module (shared)
> env_module (shared)
> mime_magic_module (shared)
> expires_module (shared)
> headers_module (shared)
> usertrack_module (shared)
> unique_id_module (shared)
> setenvif_module (shared)
> version_module (shared)
> mime_module (shared)
> dav_module (shared)
> status_module (shared)
> autoindex_module (shared)
> asis_module (shared)
> info_module (shared)
> cgi_module (shared)
> dav_fs_module (shared)
> vhost_alias_module (shared)
> negotiation_module (shared)
> dir_module (shared)
> imagemap_module (shared)
> actions_module (shared)
> speling_module (shared)
> userdir_module (shared)
> alias_module (shared)
> rewrite_module (shared)
> php5_module (shared)
> Syntax OK
>
>
>
> On Fri, Jun 7, 2013 at 4:09 PM, Mike Rumph <mike.rumph@oracle.com
> <ma...@oracle.com>> wrote:
>
> Hello Motty,
>
> You can adjust any number of performance directives as in the
> following link:
> - http://httpd.apache.org/docs/2.2/mod/mpm_common.html#maxclients
>
> And here is a link for Apache HTTP Server performance tuning in
> general:
> - http://httpd.apache.org/docs/2.2/misc/perf-tuning.html
>
> What operating system and what MPM are you running?
>
> Thanks,
>
> Mike
>
>
>
> On 6/7/2013 12:39 PM, motty cruz wrote:
>
> Hello All,
> it seems that every time some one like 80legs or any other
> crawler craws my website my server goes down. do you k now hot
> to maximize the number of child server on Apache to avoid
> turning off my machine?
>
> my Apache server is running latest Mysql, PHP and Apache22
> virtual machine 2028MB of RAM
>
> Thanks in advance
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
> <ma...@httpd.apache.org>
> For additional commands, e-mail: users-help@httpd.apache.org
> <ma...@httpd.apache.org>
>
>
Re: [users@httpd] maximize Apache services
Posted by motty cruz <mo...@gmail.com>.
Hi Mike,
Thanks for your replied; I'm using FreeBSD 9.1, here is the list of modules
Loaded Modules:
core_module (static)
mpm_prefork_module (static)
http_module (static)
so_module (static)
authn_file_module (shared)
authn_anon_module (shared)
authn_default_module (shared)
authn_alias_module (shared)
authz_host_module (shared)
authz_groupfile_module (shared)
authz_user_module (shared)
authz_dbm_module (shared)
authz_owner_module (shared)
authz_default_module (shared)
auth_basic_module (shared)
auth_digest_module (shared)
file_cache_module (shared)
cache_module (shared)
disk_cache_module (shared)
dumpio_module (shared)
reqtimeout_module (shared)
include_module (shared)
filter_module (shared)
charset_lite_module (shared)
deflate_module (shared)
log_config_module (shared)
logio_module (shared)
env_module (shared)
mime_magic_module (shared)
expires_module (shared)
headers_module (shared)
usertrack_module (shared)
unique_id_module (shared)
setenvif_module (shared)
version_module (shared)
mime_module (shared)
dav_module (shared)
status_module (shared)
autoindex_module (shared)
asis_module (shared)
info_module (shared)
cgi_module (shared)
dav_fs_module (shared)
vhost_alias_module (shared)
negotiation_module (shared)
dir_module (shared)
imagemap_module (shared)
actions_module (shared)
speling_module (shared)
userdir_module (shared)
alias_module (shared)
rewrite_module (shared)
php5_module (shared)
Syntax OK
On Fri, Jun 7, 2013 at 4:09 PM, Mike Rumph <mi...@oracle.com> wrote:
> Hello Motty,
>
> You can adjust any number of performance directives as in the following
> link:
> - http://httpd.apache.org/docs/**2.2/mod/mpm_common.html#**maxclients<http://httpd.apache.org/docs/2.2/mod/mpm_common.html#maxclients>
>
> And here is a link for Apache HTTP Server performance tuning in general:
> - http://httpd.apache.org/docs/**2.2/misc/perf-tuning.html<http://httpd.apache.org/docs/2.2/misc/perf-tuning.html>
>
> What operating system and what MPM are you running?
>
> Thanks,
>
> Mike
>
>
>
> On 6/7/2013 12:39 PM, motty cruz wrote:
>
>> Hello All,
>> it seems that every time some one like 80legs or any other crawler craws
>> my website my server goes down. do you k now hot to maximize the number of
>> child server on Apache to avoid turning off my machine?
>>
>> my Apache server is running latest Mysql, PHP and Apache22 virtual
>> machine 2028MB of RAM
>>
>> Thanks in advance
>>
>
>
> ------------------------------**------------------------------**---------
> To unsubscribe, e-mail: users-unsubscribe@httpd.**apache.org<us...@httpd.apache.org>
> For additional commands, e-mail: users-help@httpd.apache.org
>
>
Re: [users@httpd] maximize Apache services
Posted by Mike Rumph <mi...@oracle.com>.
Hello Motty,
You can adjust any number of performance directives as in the following
link:
- http://httpd.apache.org/docs/2.2/mod/mpm_common.html#maxclients
And here is a link for Apache HTTP Server performance tuning in general:
- http://httpd.apache.org/docs/2.2/misc/perf-tuning.html
What operating system and what MPM are you running?
Thanks,
Mike
On 6/7/2013 12:39 PM, motty cruz wrote:
> Hello All,
> it seems that every time some one like 80legs or any other crawler
> craws my website my server goes down. do you k now hot to maximize the
> number of child server on Apache to avoid turning off my machine?
>
> my Apache server is running latest Mysql, PHP and Apache22 virtual
> machine 2028MB of RAM
>
> Thanks in advance
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org