Using ab command, 100 concurent process fails in Linux, How to solve this issue for Linux?

1k Views Asked by At

What i have done :

  • I have used following ab command :

ab -n 1000 -c 100 http://192.168.101.143:8558/num?num=5

  • Here, I am trying to generate 1000 http request , 100 concurrent process, port is 8558, and i want factorial of 5 from my own web server .

  • Another side, My own Web Server is waiting for request at that IP address port:8558 and when we execute the ab command my own server accept the requests and did process gives response factorial of 5 but some of 10-20 request fails every time in native Linux system.

  • But When, I have run my own server on native windows system, it give 1000 correct response with 100 concurrent process on time without fail any request.

Problem:

  • In windows 100 concurrent process(thread) working fine but In Linux some request fails, Why?
  • How to solve this issue for Linux?
  • Is there any socket related issue ?

When Server on in Windows Platform:

This is ApacheBench, Version 2.3 <$Revision: 1528965 $>
Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/
Licensed to The Apache Software Foundation, http://www.apache.org/

Benchmarking 192.168.101.143 (be patient)
Completed 100 requests
Completed 200 requests
Completed 300 requests
Completed 400 requests
Completed 500 requests
Completed 600 requests
Completed 700 requests
Completed 800 requests
Completed 900 requests
Completed 1000 requests
Finished 1000 requests


Server Software:        
Server Hostname:        192.168.101.143
Server Port:            8558

Document Path:          /num?num=5
Document Length:        3 bytes

Concurrency Level:      100
Time taken for tests:   1.350 seconds
Complete requests:      1000
Failed requests:        0
Total transferred:      123000 bytes
HTML transferred:       3000 bytes
Requests per second:    652.93 [#/sec] (mean)
Time per request:       155.493 [ms] (mean)
Time per request:       1.550 [ms] (mean, across all concurrent requests)
Transfer rate:          75.20 [Kbytes/sec] received

Connection Times (ms)
              min  mean[+/-sd] median   max
Connect:        0    2   1.6      1      12
Processing:     4   74 117.5     25    1803
Waiting:        2   56  74.4     16    1281
Total:          5   150 117.8     26    1810

Percentage of the requests served within a certain time (ms)
  50%     26
  66%     42
  75%     78
  80%     93
  90%    171
  95%    218
  98%    358
  99%    536
 100%   1810 (longest request)

When Server Running in Linux Platform:

This is ApacheBench, Version 2.3 <$Revision: 1528965 $>
Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/
Licensed to The Apache Software Foundation, http://www.apache.org/

Benchmarking 192.168.101.143 (be patient)
Completed 100 requests
Completed 200 requests
Completed 300 requests
Completed 400 requests
Completed 500 requests
Completed 600 requests
Completed 700 requests
Completed 800 requests
Completed 900 requests
Completed 1000 requests
Finished 1000 requests


Server Software:        
Server Hostname:        192.168.101.143
Server Port:            8558

Document Path:          /num?num=5
Document Length:        3 bytes

Concurrency Level:      100
Time taken for tests:   9.899 seconds
Complete requests:      1000
Failed requests:        13
   (Connect: 0, Receive: 0, Length: 13, Exceptions: 0)
Total transferred:      119802 bytes
HTML transferred:       2922 bytes
Requests per second:    102.91 [#/sec] (mean)
Time per request:       120.934 [ms] (mean)
Time per request:       1.299 [ms] (mean, across all concurrent requests)
Transfer rate:          50.19 [Kbytes/sec] received

Connection Times (ms)
              min  mean[+/-sd] median   max
Connect:        0    4   3.0      3      21
Processing:     2  346 2206.7      7   18823
Waiting:        0   76 657.4      6    6371
Total:          3   90 2206.7     10   18827

Percentage of the requests served within a certain time (ms)
  50%     10
  66%     12
  75%     15
  80%     17
  90%     26
  95%     39
  98%   6341
  99%  18820
 100%  18827 (longest request)
1

There are 1 best solutions below

0
Dhvanish Thakkar On BEST ANSWER
  • In this case, I am using Virtual Linux and in that i am running my web server. so when I am execute my ab command from the another system. some what problem in port forwarding in Virtual box(NAT,Bridge,Host Only) . so, some of the request fails.

  • After that, When i have tried run my web server on host Linux and i have execute ab command in another system , i got perfect output in 100 concurrent process.

  • So from this , I conclude that this type of load testing we need to see the hardware latency as well as port forwarding issue also is there when you are testing you web server from Virtual box but in host Linux system there is no issue.