-
Hi all. I am working on a containerized .NET5.0 application and would like to understand what are some of the constraints and limitations that I may encountered when using MySqlConnector to access 1,000s of different databases simultaneously. These databases on hosted on multiple AWS RDS clusters. What are the errors (exceptions) that I may encounter and potential strategies for managing these? That is,
Are there any practical limits to the number of simultaneous connections to different databases that MySqlConnector will support comfortably? I have looked through MySqlConnector documentation and this isn't clear. I have also looked on the internet and couldn't find a good answer to address the above questions. |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments
-
You may benefit from disabling connection pooling (https://mysqlconnector.net/connection-options/#Pooling). By default, each unique connection string creates an implicit connection pool, which uses some amount of resources (memory, sockets). If you're connecting to 1,000s of servers, it may be best to avoid this overhead by adding
In general,
None that I know of, beyond the limitations of your OS (e.g., maximum number of client sockets that can be open). Let me know if you find any! |
Beta Was this translation helpful? Give feedback.
-
Thanks for your quick response @bgrainge! I'll experiment and report back any interesting findings. |
Beta Was this translation helpful? Give feedback.
You may benefit from disabling connection pooling (https://mysqlconnector.net/connection-options/#Pooling). By default, each unique connection string creates an implicit connection pool, which uses some amount of resources (memory, sockets). If you're connecting to 1,000s of servers, it may be best to avoid this overhead by adding
Pooling = False;
to each connection string. (The only downside is thatconnection.Close(); connection.Open();
will close then recreate a TCP (or SSL) connection to each server instead of reusing a pooled connection. But overall it may be better this way.)