PHP Stress Test AB command test concurrent Apache AB Test Apr_socket_connect (): Because the target machine actively refused to connect

Source: Internet
Author: User

For the majority of programmers, stress testing is a step that will never be avoided, just as the test abused me times I'm going to test like my first love under the pressure test of the problem, personal humble opinion, only for reference!!!

In general, we develop on the Windows platform, then the development environment is either LNMP or Lamp also some people with the integration package of the environment, no matter what as long as the Apache is good, as the said younger brother uses Apache, Here's what I did when I was using Apache for stress testing, and I tested it with the cmd command line as an error.

See this error after only listen to the brain hum, I have a day, why error ah, but after the query feel that this problem is very good to solve

The reason for this problem is our parameter problem, first of all to popularize the parameters, as you can see we used in the command -r-n-C then their specific meaning is as follows

-r Specifies that the program is not exited when an error message is received

-N is requests for specifying the total number of executions of the stress test

-C is concurrency, which specifies the number of concurrency for a stress test

So after these parameters we can summarize the cause of this problem is that we set the concurrency parameter is too large caused by the change

After the change to perform the stress test perfectly!!!

Say the other parameters.

-T is timelimit, the maximum time to wait for a response (in seconds)

-D does not display percentages

-H displays usage information, which is actuallyab -help

In fact, there is another solution to this situation.

1, stop Apache services;

2. Locate the apache/conf/httpd.conf file and open it with a text editor to find these two lines:
# Server-pool Management (MPM specific)
# Include Conf/extra/httpd-mpm.conf
Take the second line include ... This line of comments is removed.

3. Locate apache/conf/extra/httpd-mpm.conf file, open, find:

<ifmodule mpm_Winnt_module>
Threadsperchild 150
Maxrequestsperchild 0
</IfModule>

Turn up the top 150 and the maximum is 1920 under Windows.

Note: The name in the angle brackets is Winnt, so don't look wrong.

The above is the younger brother in his own test when encountered problems and solutions, the above is his humble opinion to help everyone

PHP Stress Test AB command test concurrent Apache AB Test Apr_socket_connect (): Unable to connect because the target machine is actively rejecting

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.