LDAP connection pooling instead of individual connections for all asks #3539
michaelalang
started this conversation in
Ideas
Replies: 2 comments 4 replies
-
In numbers that means for example:
|
Beta Was this translation helpful? Give feedback.
0 replies
-
This looks really promising, I recently started troubleshooting issues we had with connections getting dropped, quite consistently for queries in to
and on the ldap side there's just a short
|
Beta Was this translation helpful? Give feedback.
4 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Using OpenTelemetry tracing and instrumenting the Quay code I identified that we utilize an LDAP connection for nearly everything we do instead of re-using the existing connection.
This type of behaviour has also been mentioned by Customers as "Quay hammering LDAP Servers".
In the authentication endpoint (/v2/auth) this means depending on the configuration we end up with:
global_read_only_users
restricted_users
end_to_end
health endpoint (LDAP bind)Even though, it is not possible to have one connection pool for all processes we fork (since the do not share objects), adding a ConnectionPool for LDAP improves the amount of connections being created and improves the duration of the LDAP calls since the TLS handshake does not need to happen each and everytime (worst case /v2/auth = 4)
I did some verification on the theory and implemented a LDAP ConnectionPool that also re-establishes the connections from the pool if the LDAP server closes or timeout occurs and the latency improvement is between 5-10 times (59ms vs 290-600ms)
On the concept of using one connection to search and authenticate a user, the ConnectionPool I did is using Context for providing LDAP to the methods and locks to authenticate a user and switching back to the config admin DN (also fallback on failed authentications).
Any input/suggestion/idea/issue from everyone is more than welcome.
I will also raise this question in the next Engineering and Community calls.
Performance difference on left Pooled connections vs Single instance connections

current Quay single instance spin of connections for all LDAPConnection objects in the code

Beta Was this translation helpful? Give feedback.
All reactions