MAC uses the AB command for pressure measurement
1. Configure Apache in Mac
① launch Apache, open terminal
sudo apachectl -v
The Apache version is shown below
start
So Apache started up. Open Safari Browser address bar Enter "http://localhost", you can see the content "It works!" The page
② setting up a virtual end machine
Open the Apache configuration file
/etc/apache2/httpd.conf
Find "#Include/private/etc/apache2/extra/httpd-vhosts.conf" in httpd.conf, remove the "#" from the front, save and exit, and get rid of the line # meaning from/extra/ httpd-vhosts.conf this file into the virtual host configuration.
#Include /private/etc/apache2/extra/httpd-vhosts.conf
Then restart Apache.
sudo apachectl restart
Run the following command:
/etc/apache2/extra/httpd-vhosts.conf
The configuration virtual host file httpd-vhost.conf is opened and the virtual host is configured. It is important to note that the file is enabled by default for two virtual hosts as an example:
<virtualhost *:80>ServerAdmin [email protected]DocumentRoot"/usr/docs/dummy-host.example.com"ServerName dummy-host.example.comerrorlog "/private/var/log/apache2/ Dummy-host.example.com-error_log "customlog "/private/var /log/apache2/dummy-host.example.com-access_log "Common</VirtualHost><virtualhost *:80> serveradmin [email protected] documentroot "/usr/docs/dummy-host2.example.com" servername dummy-host2.example.com errorlog "/private/var/log/apache2/dummy-host2.example.com-error_log" customlog "/private/var/log/apache2/ Dummy-host2.example.com-access_log "Common</VIRTUALHOST>
You need to add the following configuration:
<virtualhost *:80>DocumentRoot"/library/webserver/documents"ServerName localhostErrorlog"/private/var/log/apache2/localhost-error_log"Customlog"/private/var/log/apache2/localhost-access_log" common</VirtualHost><virtualhost *:80> documentroot "/users/snandy/work" ServerName Mysites errorlog "/private/var/log/apache2/sites-error_log" customlog " /private/var/log/apache2/ Sites-access_log "Common<directory/> Options Indexes followsymlinks multiviews allowoverride None Order Deny,allow allow from all </Directory></VirtualHost>
Save and exit
:wqsudo apachectl restart
2. After the configuration is completed, the pressure test
4 -c 2 https://www.baidu.com/
After-n is the number of requests
After-c is the number of concurrent
①requests per second throughput rate
Calculation formula: Total number of requests/time taken to complete these requests, i.e.
Request per second=complete Requests/time taken for tests
②concurrency level number of concurrent users
To be aware of the difference between this concept and the number of concurrent connections, a user may produce multiple sessions at the same time, that is, the number of connections. Under http/1.1, IE7 supports two concurrent connections, IE8 supports 6 concurrent connections, FIREFOX3 supports 4 concurrent connections, so our number of concurrent users will have to be divided by this cardinality accordingly.
③time per request User average request Wait time
Calculation formula: The amount of time spent processing all requests (total number of requests/concurrent users), i.e.:
Time per request=time taken for tests/(complete requests/concurrency level)
④time per Request:across All concurrent Requests Server average request wait time
Calculation formula: The amount of time/Total requests processed to complete all requests, namely:
Time taken For/testscomplete requests
Turn MAC using AB Performance test Tool