apisix icon indicating copy to clipboard operation
apisix copied to clipboard

help request: The number of connections keep increase with out any requests

Open jerrytaotz opened this issue 3 years ago • 9 comments

Description

Hi All, We use helm chart to deploy APISIX in K8S pods, and find this phenomenon:

  1. The number of connections keeps increase, most of them are waiting connections, but during this time, we do not create any connections.
  2. It looks like the APISIX process restart frequently.
WeChatcaa11a8f00713cffb7616a0100134185 WeChatfd38e6e5d472137a7217261e91ce3e5d

I have no idea on it, does any one have met this problem before?

Environment

  • APISIX version (run apisix version): 1.14.1
  • Operating system (run uname -a): Linux

jerrytaotz avatar Aug 02 '22 12:08 jerrytaotz

It's strange, is an external health check probe probing this service?

tzssangglass avatar Aug 02 '22 13:08 tzssangglass

  1. we do not create any connections.

The request may not be coming from you, but from places you are ignoring.

tzssangglass avatar Aug 02 '22 13:08 tzssangglass

Let's check out how the value is calculated. These connection numbers gotten from apisix are counters which increases since apisix starts.

tokers avatar Aug 03 '22 01:08 tokers

Prometheus will periodically call the /apisix/prometheus/metrics interface to obtain monitoring data. This also leads to an increase in the number of connections.

soulbird avatar Aug 03 '22 01:08 soulbird

  1. we do not create any connections.

The request may not be coming from you, but from places you are ignoring.

I'm pretty sure it doesn't have any consumers due to it is new environment and haven't deliver to customers yet, APISIX dashboard should be the only service who might make request to apisix

jerrytaotz avatar Aug 03 '22 02:08 jerrytaotz

Let's check out how the value is calculated. These connection numbers gotten from apisix are counters which increases since apisix starts.

The metrics expression is like: sum(apisix_nginx_http_current_connections{state=~"active|reading|writing|waiting", instance=~"$instance", kubernetes_namespace=~"$namespace"}) by (state) image

jerrytaotz avatar Aug 03 '22 02:08 jerrytaotz

APISIX dashboard should be the only service who might make request to apisix

APISIX dashboard will not access the APISIX Admin API, right? cc @bzp2010

You can look at the access.log, the request information will be logged here.

tzssangglass avatar Aug 03 '22 05:08 tzssangglass

It is indeed a strange curve, it may be that the nginx worker has insufficient memory to cause the process to restart, etcd-rechable has restart behavior, and the connection is not released.

xuminwlt avatar Aug 04 '22 07:08 xuminwlt

etcd-rechable has restart behavior, and the connection is not released.

yes, this problem exists in the previous version, you need to upgrade to the latest version. ref: https://github.com/api7/lua-resty-etcd/pull/165

tzssangglass avatar Aug 04 '22 09:08 tzssangglass

Thanks, we will check it.

xuminwlt avatar Aug 11 '22 12:08 xuminwlt

This issue has been marked as stale due to 350 days of inactivity. It will be closed in 2 weeks if no further activity occurs. If this issue is still relevant, please simply write any comment. Even if closed, you can still revive the issue at any time or discuss it on the [email protected] list. Thank you for your contributions.

github-actions[bot] avatar Jul 30 '23 10:07 github-actions[bot]

This issue has been closed due to lack of activity. If you think that is incorrect, or the issue requires additional review, you can revive the issue at any time.

github-actions[bot] avatar Aug 14 '23 10:08 github-actions[bot]