Site page static and Apache tuning

Source: Internet
Author: User
Tags nginx reverse proxy

-------------------------------------------------------------------------------------------------------

Concept =

static URLs (static pages): 1. SEO 2. Access Speed block 3. Preventing SQL injection

Dynamic URL (Php page, can be passed parameters): 1. Unfavorable SEO 2. Slow access 3. There is an injected SQL may

Pseudo-static (rewrite of dynamic URLs): 1. SEO 2. Prevent injection 3. Access to the database remains unchanged

[email protected] Black eyed poet <www.chenwei.ws>----------------------------

Page static category =

On the way: 1. True static 2. Pseudo-Static

Range: 1. Global static 2. Local static (Ajax+jquery)

------------------------------------------------------------------------------------------------------

The necessity of the static page =

Apache/bin/ab.exe is an Apache self-test program that can be used to perform efficiency tests, test site concurrency, and access time for a page.

Basic use: AB [options][http[s]://]hostname[:p Ort]/path

Options option:-N Perform access times

-c Number of concurrent users

Ab.exe-n 10000-c http://localhost/test.php/* Accessed 10,000 times by 100 people, Apache will be paralyzed when changed to 1000 people

------------------------------------------------------------------------------------------------------

Adjust the maximum concurrency of Apache =

MPM (Multi-processing module, the way Apache handles concurrency), has three main ways:

1.prefork preprocessing process mode

2.worker working mode

3.winnt is typically used by Windows

Schematic diagram:

To set the Apache concurrency number steps:

1) changes in httpd.conf file

  

2) determine what the current Apache is in MPM mode

Enter Apache/bin

command, Httpd.exe-l.

Description, mpm_xxx c, if XXX is Winnt, description is Winnt, also may be prefork or worker

3) Modify the httpd-mpm.conf file (tune to 1000)

  

4) Restart Apache, test

Ab.exe-n 10000-c http://localhost/test.php

Under Linux, the generally used MPM is the prefork mode, how to configure the =

  

Recommended configuration (for most midsize sites):

Pre-Boot 5

Minimum idle Process 5

Maximum Idle Process 10

Serverlimit 1500/* New Plus, for modifying Apache programming parameters */

Maximum Concurrency 1000

Keep the process alive 0

If the site has PV values on millions, modify:

Serverlimit 2500

Maximum Concurrency 2000

More PV, an Apache can not meet the demand, using load balancer or Nginx reverse proxy.

----------------------------------------------------------------------------------------------------

Related Article

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.