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

Kong spamming connect/disconnect to postgres #13800

Open
1 task done
morpig opened this issue Oct 29, 2024 · 2 comments
Open
1 task done

Kong spamming connect/disconnect to postgres #13800

morpig opened this issue Oct 29, 2024 · 2 comments
Labels
pending author feedback Waiting for the issue author to get back to a maintainer with findings, more details, etc... stale

Comments

@morpig
Copy link

morpig commented Oct 29, 2024

Is there an existing issue for this?

  • I have searched the existing issues

Kong version ($ kong version)

3.6.1

Current Behavior

Running Kong DB-setup with postgres, and logs from pgbouncer shows tons of connect/disconnects by kong.

env as below:

  env:
    pg_database: kong
    pg_schema: public
    pg_ssl: on
    pg_pool_size: 2
    pg_keepalive_timeout: 300
    pg_max_concurrent_queries: 2
    pg_ro_max_concurrent_queries: 2
    pg_ro_pool_size: 2
    pg_ro_keepalive_timeout: 300
2024-10-29 01:09:00.452 UTC [551967] LOG C-0x55ee30a124b8: kong/[email protected]:11925 login attempt: db=kong user=kong tls=TLSv1.3/TLS_AES_256_GCM_SHA384 replication=no
2024-10-29 01:09:00.467 UTC [551967] LOG C-0x55ee30a124b8: kong/[email protected]:11925 closing because: client unexpected eof (age=0s)
2024-10-29 01:09:01.393 UTC [551967] LOG C-0x55ee30a124b8: kong/[email protected]:37791 login attempt: db=kong user=kong tls=TLSv1.3/TLS_AES_256_GCM_SHA384 replication=no
2024-10-29 01:09:01.400 UTC [551967] LOG C-0x55ee30a124b8: kong/[email protected]:37791 closing because: client close request (age=0s)
2024-10-29 01:09:03.352 UTC [551967] LOG C-0x55ee30a124b8: kong/[email protected]:14789 login attempt: db=kong user=kong tls=TLSv1.3/TLS_AES_256_GCM_SHA384 replication=no
2024-10-29 01:09:03.501 UTC [551967] LOG C-0x55ee30be08f8: kong/[email protected]:14101 login attempt: db=kong user=kong tls=TLSv1.3/TLS_AES_256_GCM_SHA384 replication=no
2024-10-29 01:09:03.660 UTC [551967] LOG C-0x55ee30a124b8: kong/[email protected]:14789 closing because: client unexpected eof (age=0s)
2024-10-29 01:09:03.810 UTC [551967] LOG C-0x55ee30be08f8: kong/[email protected]:14101 closing because: client unexpected eof (age=0s)
2024-10-29 01:09:03.981 UTC [551967] LOG C-0x55ee30be08f8: kong/[email protected]:49950 login attempt: db=kong user=kong tls=TLSv1.3/TLS_AES_256_GCM_SHA384 replication=no
2024-10-29 01:09:03.998 UTC [551967] LOG C-0x55ee30be08f8: kong/[email protected]:49950 closing because: client unexpected eof (age=0s)
2024-10-29 01:09:04.395 UTC [551967] LOG C-0x55ee30be08f8: kong/[email protected]:3356 login attempt: db=kong user=kong tls=TLSv1.3/TLS_AES_256_GCM_SHA384 replication=no
2024-10-29 01:09:04.403 UTC [551967] LOG C-0x55ee30be08f8: kong/[email protected]:3356 closing because: client close request (age=0s)
2024-10-29 01:09:04.699 UTC [551967] LOG C-0x55ee30be08f8: kong/[email protected]:64474 login attempt: db=kong user=kong tls=TLSv1.3/TLS_AES_256_GCM_SHA384 replication=no
2024-10-29 01:09:05.023 UTC [551967] LOG C-0x55ee30be08f8: kong/[email protected]:64474 closing because: client unexpected eof (age=0s)
2024-10-29 01:09:05.314 UTC [551967] LOG C-0x55ee30be08f8: kong/[email protected]:36957 login attempt: db=kong user=kong tls=TLSv1.3/TLS_AES_256_GCM_SHA384 replication=no
2024-10-29 01:09:05.624 UTC [551967] LOG C-0x55ee30be08f8: kong/[email protected]:36957 closing because: client unexpected eof (age=0s)
2024-10-29 01:09:05.630 UTC [551967] LOG C-0x55ee30be08f8: kong/[email protected]:38684 login attempt: db=kong user=kong tls=TLSv1.3/TLS_AES_256_GCM_SHA384 replication=no
2024-10-29 01:09:05.647 UTC [551967] LOG C-0x55ee30be08f8: kong/[email protected]:38684 closing because: client unexpected eof (age=0s)
2024-10-29 01:09:06.550 UTC [551967] LOG C-0x55ee30be08f8: kong/[email protected]:18820 login attempt: db=kong user=kong tls=TLSv1.3/TLS_AES_256_GCM_SHA384 replication=no
2024-10-29 01:09:06.551 UTC [551967] LOG C-0x55ee30a124b8: kong/[email protected]:10169 login attempt: db=kong user=kong tls=TLSv1.3/TLS_AES_256_GCM_SHA384 replication=no
2024-10-29 01:09:06.558 UTC [551967] LOG C-0x55ee30be08f8: kong/[email protected]:18820 closing because: client close request (age=0s)
2024-10-29 01:09:06.558 UTC [551967] LOG C-0x55ee30a124b8: kong/[email protected]:10169 closing because: client close request (age=0s)
2024-10-29 01:09:07.112 UTC [551967] LOG C-0x55ee30a124b8: kong/[email protected]:47949 login attempt: db=kong user=kong tls=TLSv1.3/TLS_AES_256_GCM_SHA384 replication=no
2024-10-29 01:09:07.113 UTC [551967] LOG C-0x55ee30be08f8: kong/[email protected]:10418 login attempt: db=kong user=kong tls=TLSv1.3/TLS_AES_256_GCM_SHA384 replication=no
2024-10-29 01:09:07.121 UTC [551967] LOG C-0x55ee30a124b8: kong/[email protected]:47949 closing because: client close request (age=0s)
2024-10-29 01:09:07.122 UTC [551967] LOG C-0x55ee30be08f8: kong/[email protected]:10418 closing because: client close request (age=0s)
2024-10-29 01:09:07.395 UTC [551967] LOG C-0x55ee30be08f8: kong/[email protected]:16634 login attempt: db=kong user=kong tls=TLSv1.3/TLS_AES_256_GCM_SHA384 replication=no
2024-10-29 01:09:07.403 UTC [551967] LOG C-0x55ee30be08f8: kong/[email protected]:16634 closing because: client close request (age=0s)
2024-10-29 01:09:07.680 UTC [551967] LOG C-0x55ee30be08f8: kong/[email protected]:12127 login attempt: db=kong user=kong tls=TLSv1.3/TLS_AES_256_GCM_SHA384 replication=no
2024-10-29 01:09:07.681 UTC [551967] LOG C-0x55ee30a124b8: kong/[email protected]:6576 login attempt: db=kong user=kong tls=TLSv1.3/TLS_AES_256_GCM_SHA384 replication=no
2024-10-29 01:09:07.685 UTC [551967] LOG C-0x55ee30be08f8: kong/[email protected]:12127 closing because: client close request (age=0s)
2024-10-29 01:09:07.686 UTC [551967] LOG C-0x55ee30a124b8: kong/[email protected]:6576 closing because: client close request (age=0s)

Expected Behavior

Expecting it to maintain persistent DB connection per worker/pods instead. Not expecting tons of connect/disconnect.

Steps To Reproduce

No response

Anything else?

No response

@Oyami-Srk
Copy link
Member

Oyami-Srk commented Oct 31, 2024

AFAIK the connection for Postgres under Kong is managed by external libraries, and the problem is Postgres connection isn't reused. You can check #1517 for details.
Will this affect the concurrency of your deployment?

@Oyami-Srk Oyami-Srk added the pending author feedback Waiting for the issue author to get back to a maintainer with findings, more details, etc... label Nov 4, 2024
Copy link
Contributor

This issue is marked as stale because it has been open for 14 days with no activity.

@github-actions github-actions bot added the stale label Nov 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
pending author feedback Waiting for the issue author to get back to a maintainer with findings, more details, etc... stale
Projects
None yet
Development

No branches or pull requests

3 participants
@morpig @Oyami-Srk and others