Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

处理2w多请求后出现卡住(连接连不上)问题 #361

Closed
kimkit opened this issue Aug 30, 2015 · 1 comment
Closed

处理2w多请求后出现卡住(连接连不上)问题 #361

kimkit opened this issue Aug 30, 2015 · 1 comment

Comments

@kimkit
Copy link
Contributor

kimkit commented Aug 30, 2015

服务端使用的代码是swoole(1.7.19-rc1)首页的HttpServer,运行环境是virtualbox+ubuntu14.04,ab测试是直接在ubuntu里执行的。

ab测试的结果如下,第一次测试到2w多会卡住,直到超时;立刻进行第二次测试,直接超时(此时包括系统的ssh等都连接不上);过了一会儿进行第三次测试,结果跟第一次一样。我猜测应该是系统的连接资源没有释放导致的,谁能有详细点的解释?

第一次:

root@ubuntu:~# ab -c 10 -t 30 http://127.0.0.1/
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 127.0.0.1 (be patient)
Completed 5000 requests
Completed 10000 requests
Completed 15000 requests
Completed 20000 requests
apr_pollset_poll: The timeout specified has expired (70007)
Total of 23717 requests completed

第二次:

root@ubuntu:~# ab -c 10 -t 30 http://127.0.0.1/
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 127.0.0.1 (be patient)
apr_pollset_poll: The timeout specified has expired (70007)

第三次:

root@ubuntu:~# ab -c 10 -t 30 http://127.0.0.1/
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 127.0.0.1 (be patient)
Completed 5000 requests
Completed 10000 requests
Completed 15000 requests
Completed 20000 requests
apr_pollset_poll: The timeout specified has expired (70007)
Total of 23718 requests completed
@matyhtf
Copy link
Member

matyhtf commented Sep 7, 2015

ab 测试请加-k参数启用长连接,或者 启用 快速回收,否则本地端口会不够用。

@matyhtf matyhtf closed this as completed Sep 7, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants