Test ab fails after 100 connections with many workers tarantool
This place is for bug reports and development discussions only. For general questions and discussions, please join the openresty-en mailing list instead: https://openresty.org/en/community.html
Ensure you have provided the following details while reporting a problem:
- The exact version of the related software, including but not limited to the OpenResty version
(if any), the NGINX core version, the
ngx_luamodule version, and your operating system version. - A minimal and standalone test case that others can easily run on their side and reproduce the issue you are seeing.
- Do not simply say "something is broken" or "something does not work". Always provide as much details as possible. Always describe the symptoms and your expected results.
- You can (temporarily) enable the nginx debugging logs to see the internal workings
of NGINX in your nginx''s
error.logfile. See http://nginx.org/en/docs/debugging_log.html The same instructions apply equally well to OpenResty. - If you are seeing crashes, please provide the full backtrace for the crash. See https://www.nginx.com/resources/wiki/start/topics/tutorials/debugging/#core-dump for more details.
Please, do not use Chinese here. This place is considered English only. If you really want to use Chinese, please join and post to the openresty (Chinese) mailing list instead. Please see https://openresty.org/en/community.html Thanks for your cooperation.
Hi, trying to test with ab on tarantool I noticed that if I put only one worker in the openresty configuration the test doesn't fail instead if I put more workers, having more CPUs, the test fails after 100,000 connections. Can you give me an explanation?
you can see the error log file in /usr/local/openresty/nginx/logs/error.log. I think it is due to the lack of the local port.
you can see the error log file in /usr/local/openresty/nginx/logs/error.log. I think it is due to the lack of the local port.
This is the error:
apr_socket_connect(): Cannot assign requested address (99)
You need to calculate the total number of connections you need.
Suppose there is only one IP address on your host. So there are not more than 65000 local ports available. You can check the local port range by the following cmd.
➜ ~ sudo sysctl -a | grep local_port
net.ipv4.ip_local_port_range = 32768 60999
One connection would consume one local port.
Every time-wait TCP connection would last for a long time if you did not enable tcp_tw_reuse. Check it by the following cmd.
sudo sysctl -a | grep reuse
net.ipv4.tcp_tw_reuse = 1