How the Apache heavy load server should optimize

Source: Internet
Author: User
20,000 requests a day are really small, but if in the peak period, but not at night or other time, a normal distribution, and are required time to download services, the load is still very large.

The maximum number of processes that Apache allows to open for requests is the 256,maxclients limit of 256. If the user is more, the user can only see waiting for reply .... Then wait until the next available process appears. The maximum number is the Apache program-its NT version can have 1024, but the UNIX version is only 256, you can src/include/httpd.h
See:
#ifndef Hard_server_limit
#ifdef WIN32
#define HARD_SERVER_LIMIT 1024
#else
#define HARD_SERVER_LIMIT 256
#endif
#endif
You can tune it to 1024 and then compile your system. I remember in httpd.conf.
To change the configuration, the default seems to be 150. For the following machine, turn to top 512.
Dead, if again high, the system can not stand.

In addition, some systems also limit the maximum number of processes for a user. You can use Ulimit-u.
View Linux is generally 256. So if you really want to have Apache over this number, you have to adjust
This parameter:
Ulimit-u Unlimited
This parameter should be modified before Apache runs, so it is recommended to add to Apachectl:
Case $ARG in
Start
If [$RUNNING-eq 1]; Then
echo "$ $ARG: httpd (PID $PID) already Running"
Continue
Change into
Case $ARG in
Start
Ulimit-u Unlimited
If [$RUNNING-eq 1]; Then
echo "$ $ARG: httpd (PID $PID) already Running"
Continue


Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.