Go: page Cache test

Source: Internet
Author: User

Review of issues

Because the site is frequently requested pages to generate Web pages dynamically, resulting in a large consumption of system resources, in order to increase user response time for such web page access, use the cache technology for that part of the page.

For this type of test is very simple, only require testers to do the following two points can be fully manageable:

1, the cache in the business implementation of the rules have a good understanding (specifically, there are pages using the Cache,cache of the length of the effective time, the measured server-side physical memory, how much space allocated to the cache).

2. Understand the correlation performance counters (such as memory) that need to be focused on during testing.

Test the first step to verify

Verify that the cache exists and that the implementation rules are met. For example, to access a dynamic page with the cache, the first request page response time is 10 seconds, the second is 3 seconds, the response time of Percent is not greater than 4 seconds, then we can temporarily consider the cache to take effect. During the subsequent test, the cache was tested using the Ramp-up method, and the response time result was seen roughly as the RPT was on a high starting point when the first thread accessed the page because the Web server had to access the database and generate the page and store it in the cache, the process consumes most of the RPT, and when it runs to the second thread, the RPT curves down to a very low point, because the second thread reads the desired page directly from the in-memory cache, and the point and subsequent threads are almost on the same horizontal line, and the continuation is smooth. When the scene is running for about 20 minutes, it is exactly at the end of the cache life cycle, repeating the above description of the RPT curve trajectory. Here rpt does not rise as the user rises, giving the impression that a cookie is used.

Test the second step, concurrency

Test the cache for long wait times by setting the concurrency point to access the same dynamic page. Because the first thread that arrives at the destination first stores it in memory, accesses the database and generates the cache of the page, this time the other threads only wait for the front line to finish the write operation before the read operation, we know that a thread in a single operation process only allow write or Read permission, Both permissions do not allow simultaneous range in one line, and if the thread synchronization lock in the program is not handled well enough, it can cause unexpected occurrences. For example, when multiple users access the page at the same time, all thread requests may fail, and in this case, the tester can first try to test with serial or no concurrency points and draw a conclusion. Experience with this problem is most likely caused by a problem with the thread synchronization mechanism. In the test process to pay more attention to the memory counters of web SERVER which includes (paging ratio \ pages Reads\ Private byte\ Working set) if the cache hit rate, then the memory paging and pages reads will be high if the large user volume access , memory can not free up space in a timely manner, then working set and private byte will be very high, if there is a suspicion of memory leak phenomenon, you can add other related business together, the execution of the scene longer, see the impact on other business. Here the cache hit rate is the key issue of the cache, such as the above counter is not very understanding also please check the relevant Help file, here do not do too much explanation.

Advantages of using the cache

Save the CPU and memory resources that are consumed when the page is generated. Access to large users makes RPT as short as it is.

The reduced pressure on the database is obvious. I personally think this is the most important advantage.

For the end user and the server, the user's request time is shortened, then reduced the resource waste of the server.

Go: page Cache test

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.