Five "military rules" for server optimization (1)

Source: Internet
Author: User

The following five rules can help you optimize the installed Drupal server. Examples are provided to illustrate how to use these rules. Server optimization is a huge field that is constantly evolving. However, we can study and analyze some simple situations to understand complex situations.

Next we will focus on several variables to measure their impact on performance.

First rule: optimization is impossible if performance is not tested.

There are many tools available to accurately evaluate and test performance, but this article focuses on the most important tool: Apache Benchmark. You can use this tool to query a specific page on your website and even send cooki information to it to simulate authenticated users. You can use Apache Benchmark on the command line on the server that is being tested, and still obtain valid results because the tool occupies a small amount of CPU and memory resources. The following is a typical usage:

$ AB-n 1000-c 20 http://example.com/
The value here is as follows:
N = number of page requests
C = number of concurrent connections
The most important parameter is c, that is, the number of concurrent requests, and n must be large enough to provide stable results. The key lies in the use of different c values to test the website, starting from a small value, gradually increasing until the return value of "requests per second" starts to decline. For example:
$ AB-n 1000-c 20 http://example.com/| grep 'requests per second'
Requests per second: 45.29 [#/sec] average value)
$ AB-n 1000-c 40 http://example.com/| grep 'requests per second'
Requests per second: 46.91 [#/sec] average value)
$ AB-n 1000-c 60 http://example.com/| grep 'requests per second'
Requests per second: 8.55 [#/sec] average value)
$ AB-n 1000-c 80 http://example.com/| grep 'requests per second'
Requests per second: 2.21 [#/sec] average value)

We can use smaller increments to refine the c value, but it is usually enough to take 10 as the nearest multiple.


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.