Apache Performance Optimization Tips

xiaoxiao2021-03-06  57

Apache Performance Optimization Tips

Apache Performance Optimization Tips

Jingkang Technology

This paper briefly introduces several techniques that optimize Apache and is very useful in actual combat.

Upgrade Apache to the latest version, the new version often contains performance improvement and security updates.

Set "hostnamelookups off" in httpd.conf to avoid reverse queries for each visitor's DNS domain name.

For busy websites, set "MaxClients 230" or higher in httpd.conf. This setting allows more HTTPD processes to respond simultaneously and avoids the situation where the processor is queued.

Use another server to process the image file.

Browser buffer technology is adopted by your web page and the CGI page. Specific articles can refer to this site: Adopt MOD_GZIP accelerate zope and apache

Keep your Apache slim, compile those modules that only need, modify the SRC / Configuration file before compiling, and comment with ## before the module that is unwanted.

If the traffic log is not required, the transferlog in httpd.conf points to / dev / NULL /

Unless you are sure you are using the .htaccess file to control some directory permissions, set "AllowOverride None", so you will not go to Apache to search for. Htaccess files in each directory.

Don't let the undesired background process run.

Don't write the page or log files on the network disk, such as NFS.

Don't let Apache (httpd) run in inetd mode.

Don't let X Windows run on your web server, close X with Ctrl-alt-backspace.

Avoid using SSI TAG.

In the CGI script:

Document I / O: The fewer the number of files opened, the better.

Shell Command: Use full path to call the shell command.

If your website is driven by CGI, then use MOD_PERL.

In your web page directory, don't make more than 1000 files, the more the file is spent in positioning, the more time.

The less the image on the web server is, and it is ensured that each image is running via the picture compressor.

Do a pressure test for your website, it is recommended to test the AB command comes with Apache.

For the best performance, it is best to unplug the network, so your web server is very safe, and the load is now dropped to 0, :-)

转载请注明原文地址:https://www.9cbs.com/read-118206.html

New Post(0)