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

Connection Keep Alive #783

Closed
StanGirard opened this issue Apr 28, 2024 · 7 comments
Closed

Connection Keep Alive #783

StanGirard opened this issue Apr 28, 2024 · 7 comments
Labels
bug Something isn't working

Comments

@StanGirard
Copy link

Hey !

It seems that the TLS Handshake happens every query.

image

Implementing a Keep-alive and keeping the connection alive would save around 60ms per query.

@StanGirard StanGirard added the bug Something isn't working label Apr 28, 2024
@StanGirard
Copy link
Author

Hey @juancarlospaco,

I've been battling with it for almost a week.

Going with direct connection to the database with RAW SQL queries makes it way faster. I looked into Kong, it should be around 8ms of latency not 40ms.

There might be something funny happening.

image

Here you can see the time when I do queries directly to database and when using the python sdk.

Would love to help you investigate.

Both my backend and my supabase are in Ireland on AWS.

@juancarlospaco
Copy link
Contributor

I can confirm it is not the "keep-alive" by itself IMHO, something funny is happening somehow, will keep investigating...

@StanGirard
Copy link
Author

@juancarlospaco Thanks Juan! Let me know if i can help anyhow

@StanGirard
Copy link
Author

Hello @juancarlospaco, any update of this issue ?

@juancarlospaco
Copy link
Contributor

juancarlospaco commented Aug 19, 2024

As explained at #783 (comment)
it is enabled and hardcoded from httpx, and basically nowadays it is mostly ignored whatsoever.

Make sure you are not running too old libs, or running in an env in debug mode
(sometimes things are slower or different in debuggers or with debug mode active etc).

In the latest version of the clients, it has HTTP2 enabled which ignores all of this and uses persistent connections by default.

@silentworks
Copy link
Contributor

Closing as there has been no reply from OP for over a month.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants