To test the performance gains from a reverse proxy server, test performance data comparisons using a reverse proxy server and not using a reverse proxy server.
1. Do not use reverse proxy
Test a picture 57817 bytes of a picture to make 1000 requests, the concurrency is 100, the performance data is as follows:
After many tests, it was found that Apache processes 4500~5000 requests per second without using a reverse proxy.
2. Next, use the varnish reverse proxy to accelerate the HTTP request.
However, it is found that the number of requests processed per second has not been significantly improved. Apache processes 5500~6000 Requests per second.
View the next Header
Indicates that the varnish reverse proxy server has been successfully turned on, but why is the acceleration not obvious? Then command line input varnishstat to view the Varnish monitor program. As follows:
Explain the following information: Cache_hit varnish the number of times to find and hit buffers in the cache. Cache_miss varnish The number of buffers that were found in the cache but not hit. Client_req the cumulative number of HTTP requests sent by the browser to the varnish reverse proxy finds a good hit rate, increasing concurrency and requesting a trial:
Also 5,000 requests for the picture, the concurrency is 1000, the performance data is as follows: When the varnish reverse proxy is not used:
After many tests, it was found that Apache processes 200~500 requests per second without using a reverse proxy.
To continue testing in the case of using a reverse proxy:
Well, this is a clear effect. It's about 4500~5500.
Configuration problems with varnish: The configuration in the/etc/varnish/default.vcl file is as follows; (no cache rules, try configuring cache rules later)
In the/etc/varnish/varnish.params file
The listening port is 6081, which is explained below, can be set at startup-a parameter, or set the Varnish_listen_port port in the Varnish.params file. That is, in the stress test to go varnish reverse proxy, you need to add 6081 port number.