Open StanGirard opened 4 months ago
is it really required? 🤔
Also, it should be ON by default whatsoever, because it is hardcoded:
It is interesting nevertheless, will keep investigating...
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.
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.
I can confirm it is not the "keep-alive" by itself IMHO, something funny is happening somehow, will keep investigating...
@juancarlospaco Thanks Juan! Let me know if i can help anyhow
Hello @juancarlospaco, any update of this issue ?
As explained at https://github.com/supabase/supabase-py/issues/783#issuecomment-2087544554 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.
Hey !
It seems that the TLS Handshake happens every query.
Implementing a Keep-alive and keeping the connection alive would save around 60ms per query.