You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@apisix.apache.org by hui li <yo...@apache.org> on 2020/04/15 07:56:04 UTC
Backlog parameter value tuning
APISIX backlog is currently the default value(Usually 128), and it is prone
to packet loss in the listen queue and semi-link queue in large concurrent
scenarios.
APISIX is based on nginx. The backlog value of nginx is determined by two
system configurations and one configuration value in nginx.conf:
1. System parameters:
sysctl net.ipv4.tcp_max_syn_backlog
sysctl net.core.somaxconn
2. nginx.conf:
default_server backlog
How to check the backlog size of APISIX process?
Use the 'ss -lnt' command
Re: Backlog parameter value tuning
Posted by hui li <yo...@apache.org>.
Here is the Github issue:
https://github.com/apache/incubator-apisix/issues/1456
Lang Wang <to...@apache.org> 于2020年4月15日周三 下午5:26写道:
> > 2. nginx.conf:
>
> The default value for this in nginx is: `listen $port [backlog=511]`
>
> $ ss -lnt
> State Recv-Q Send-Q Local Address:Port Peer Address:Port
> LISTEN 0 511 *:9180 *:*
>
> And the real `running nginx's backlog` value is:
> MIN(net.ipv4.tcp_max_syn_backlog, net.core.somaxconn, nginx's listen
> backlog)
>
>
>
> YuanSheng Wang <me...@apache.org> 于2020年4月15日周三 下午5:06写道:
>
> > > 1. System parameters:
> >
> > We can write it in the user installation manual.
> >
> > > 2. nginx.conf:
> >
> > How about changing the default value of `backlog` to 512?
> >
> > According to the current hardware and network, this value is better.
> >
> >
> > On Wed, Apr 15, 2020 at 3:56 PM hui li <yo...@apache.org> wrote:
> >
> > > APISIX backlog is currently the default value(Usually 128), and it is
> > prone
> > > to packet loss in the listen queue and semi-link queue in large
> > concurrent
> > > scenarios.
> > >
> > > APISIX is based on nginx. The backlog value of nginx is determined by
> two
> > > system configurations and one configuration value in nginx.conf:
> > > 1. System parameters:
> > > sysctl net.ipv4.tcp_max_syn_backlog
> > > sysctl net.core.somaxconn
> > > 2. nginx.conf:
> > > default_server backlog
> > >
> > > How to check the backlog size of APISIX process?
> > > Use the 'ss -lnt' command
> > >
> >
> >
> > --
> > *MembPhis*
> > My github: https://github.com/membphis
> > Apache APISIX: https://github.com/apache/incubator-apisix
> >
>
Re: Backlog parameter value tuning
Posted by YuanSheng Wang <me...@apache.org>.
On Wed, Apr 15, 2020 at 5:26 PM Lang Wang <to...@apache.org> wrote:
> > 2. nginx.conf:
>
> The default value for this in nginx is: `listen $port [backlog=511]`
>
http://nginx.org/en/docs/http/ngx_http_core_module.html#listen
you were right. the default value is enough for most user.
Add an option to allow users to customize the configuration.
>
> $ ss -lnt
> State Recv-Q Send-Q Local Address:Port Peer Address:Port
> LISTEN 0 511 *:9180 *:*
>
> And the real `running nginx's backlog` value is:
> MIN(net.ipv4.tcp_max_syn_backlog, net.core.somaxconn, nginx's listen
> backlog)
>
>
>
> YuanSheng Wang <me...@apache.org> 于2020年4月15日周三 下午5:06写道:
>
> > > 1. System parameters:
> >
> > We can write it in the user installation manual.
> >
> > > 2. nginx.conf:
> >
> > How about changing the default value of `backlog` to 512?
> >
> > According to the current hardware and network, this value is better.
> >
> >
> > On Wed, Apr 15, 2020 at 3:56 PM hui li <yo...@apache.org> wrote:
> >
> > > APISIX backlog is currently the default value(Usually 128), and it is
> > prone
> > > to packet loss in the listen queue and semi-link queue in large
> > concurrent
> > > scenarios.
> > >
> > > APISIX is based on nginx. The backlog value of nginx is determined by
> two
> > > system configurations and one configuration value in nginx.conf:
> > > 1. System parameters:
> > > sysctl net.ipv4.tcp_max_syn_backlog
> > > sysctl net.core.somaxconn
> > > 2. nginx.conf:
> > > default_server backlog
> > >
> > > How to check the backlog size of APISIX process?
> > > Use the 'ss -lnt' command
> > >
> >
> >
> > --
> > *MembPhis*
> > My github: https://github.com/membphis
> > Apache APISIX: https://github.com/apache/incubator-apisix
> >
>
--
*MembPhis*
My github: https://github.com/membphis
Apache APISIX: https://github.com/apache/incubator-apisix
Re: Backlog parameter value tuning
Posted by Lang Wang <to...@apache.org>.
> 2. nginx.conf:
The default value for this in nginx is: `listen $port [backlog=511]`
$ ss -lnt
State Recv-Q Send-Q Local Address:Port Peer Address:Port
LISTEN 0 511 *:9180 *:*
And the real `running nginx's backlog` value is:
MIN(net.ipv4.tcp_max_syn_backlog, net.core.somaxconn, nginx's listen
backlog)
YuanSheng Wang <me...@apache.org> 于2020年4月15日周三 下午5:06写道:
> > 1. System parameters:
>
> We can write it in the user installation manual.
>
> > 2. nginx.conf:
>
> How about changing the default value of `backlog` to 512?
>
> According to the current hardware and network, this value is better.
>
>
> On Wed, Apr 15, 2020 at 3:56 PM hui li <yo...@apache.org> wrote:
>
> > APISIX backlog is currently the default value(Usually 128), and it is
> prone
> > to packet loss in the listen queue and semi-link queue in large
> concurrent
> > scenarios.
> >
> > APISIX is based on nginx. The backlog value of nginx is determined by two
> > system configurations and one configuration value in nginx.conf:
> > 1. System parameters:
> > sysctl net.ipv4.tcp_max_syn_backlog
> > sysctl net.core.somaxconn
> > 2. nginx.conf:
> > default_server backlog
> >
> > How to check the backlog size of APISIX process?
> > Use the 'ss -lnt' command
> >
>
>
> --
> *MembPhis*
> My github: https://github.com/membphis
> Apache APISIX: https://github.com/apache/incubator-apisix
>
Re: Backlog parameter value tuning
Posted by YuanSheng Wang <me...@apache.org>.
> 1. System parameters:
We can write it in the user installation manual.
> 2. nginx.conf:
How about changing the default value of `backlog` to 512?
According to the current hardware and network, this value is better.
On Wed, Apr 15, 2020 at 3:56 PM hui li <yo...@apache.org> wrote:
> APISIX backlog is currently the default value(Usually 128), and it is prone
> to packet loss in the listen queue and semi-link queue in large concurrent
> scenarios.
>
> APISIX is based on nginx. The backlog value of nginx is determined by two
> system configurations and one configuration value in nginx.conf:
> 1. System parameters:
> sysctl net.ipv4.tcp_max_syn_backlog
> sysctl net.core.somaxconn
> 2. nginx.conf:
> default_server backlog
>
> How to check the backlog size of APISIX process?
> Use the 'ss -lnt' command
>
--
*MembPhis*
My github: https://github.com/membphis
Apache APISIX: https://github.com/apache/incubator-apisix