-
Notifications
You must be signed in to change notification settings - Fork 330
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.Open() slow #258
Comments
Yes (or more). This is primarily due to attempting to put the connection in a known good state. If you are not using connection pooling, the client needs to connect to the server, receive a handshake packet, send an auth/login packet, and receive a success response. If you are using connection pooling, then a connection is pulled from the pool and a ping packet is sent (to confirm the connection is still alive). [Note: this may be able to be removed; see below.] Then, if You can achieve a speedup (at the cost of correctness and safety) by not resetting the connection; set See #178 for the suggestion to reset the connection (in the background) when it's returned to the pool, which could eliminate 1-2 roundtrips when retrieving a pooled connector. Even without implementing the suggestion in that case, I think it should be safe for us to remove the "ping" when What is the network latency between your client and the MySQL Server? |
My database server is a 25ms round trip from my web server. I'm trying to migrate away from ASP.NET 4 / Entity Framework / SQL Server, where I've had the luxury of not having to worry about this very much because the the whole context creation-query-disposal process was completing in single round trip time. Now on dotnetcore and MySQL with three round trips to open the connection plus a fourth for the query, suddenly it's noticeable. Thanks for the Thanks for such a fast and thorough response. |
Thanks for pointing this out (it was very out-of-date); fixed in ec3d086. |
This has been implemented in 0.26.4. |
I don't think there's anything more for this case that isn't already covered elsewhere. Summary:
|
I'm finding Connection.Open() very slow when using a remote database. It's taking approximately 3x the ping time. Is it making three round trips?
The text was updated successfully, but these errors were encountered: