LoginSignup
1
2

More than 5 years have passed since last update.

Mac OSXでapache benchが動かない時の対処。apr_socket_connect(): Operation already in progress

Posted at

現象

ApacheBenchが起動後に「apr_socket_connect(): Operation already in progress」ですぐ落ちる。

環境

OS X El Capitan 10.11.6

エラーメッセージ

16:42:16 ~/  $ ab -n 100000 -c 1000  http://xxxxxxxx.elb.amazonaws.com/
This is ApacheBench, Version 2.3 <$Revision: 655654 $>
Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/
Licensed to The Apache Software Foundation, http://www.apache.org/

Benchmarking  xxxxxxxx.elb.amazonaws.com/ (be patient)
Send request failed!

Test aborted after 10 failures

apr_socket_connect(): Operation already in progress (37)

対応、Apacheのバージョンアップ

現在のhttpdのunlink

  $ brew unlink homebrew/apache/httpd22
Unlinking /usr/local/Cellar/httpd22/2.2.31... 30 symlinks removed

httpd24のインストール

Apache/2.4.23にバージョンアップ

$ brew install httpd24
==> Installing httpd24 from homebrew/apache
==> Installing dependencies for homebrew/apache/httpd24: apr, apr-util
==> Installing homebrew/apache/httpd24 dependency: apr

・・・
  apachectl start
==> Summary
🍺  /usr/local/Cellar/httpd24/2.4.23_2: 210 files, 4.2M

成功

  $ ab -n 100000 -c 1000 -r http://xxxxxxxx.elb.amazonaws.com/
This is ApacheBench, Version 2.3 <$Revision: 1748469 $>
Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/
Licensed to The Apache Software Foundation, http://www.apache.org/

Benchmarking xxxxxxxx.elb.amazonaws.com/ (be patient)
Completed 10000 requests
Completed 20000 requests
Completed 30000 requests
Completed 40000 requests
Completed 50000 requests
Completed 60000 requests
Completed 70000 requests
Completed 80000 requests
Completed 90000 requests
Completed 100000 requests
Finished 100000 requests


Server Software:        Apache/2.4.23
Server Hostname:        xxxxxxxx.elb.amazonaws.com/
Server Port:            80

Document Path:          /
Document Length:        319 bytes

Concurrency Level:      1000
Time taken for tests:   69.517 seconds
Complete requests:      100000
Failed requests:        32
   (Connect: 0, Receive: 0, Length: 32, Exceptions: 0)
Non-2xx responses:      32
Total transferred:      56484160 bytes
HTML transferred:       31889792 bytes
Requests per second:    1438.49 [#/sec] (mean)
Time per request:       695.172 [ms] (mean)
Time per request:       0.695 [ms] (mean, across all concurrent requests)
Transfer rate:          793.48 [Kbytes/sec] received

Connection Times (ms)
              min  mean[+/-sd] median   max
Connect:      162  281  79.3    271    1752
Processing:   165  392 132.4    373    3166
Waiting:      165  391 132.2    373    3166
Total:        352  673 172.0    647    4550

Percentage of the requests served within a certain time (ms)
  50%    647
  66%    718
  75%    756
  80%    774
  90%    814
  95%    848
  98%    960
  99%   1122
 100%   4550 (longest request)
1
2
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
2