Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8696645
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T01:19:22+00:00 2026-06-13T01:19:22+00:00

I was reading about the MySQL: Using Connector/Net with Connection Pooling . It is

  • 0

I was reading about the MySQL: Using Connector/Net with Connection Pooling. It is suggested to not use a global MySqlConnection object and manually open/close it. Further, it’s suggested to use the MySqlHelper instead of working with MySqlCommand objects.

So, assuming I have a CONNECTION_STRING setup, I could do something like:

MySqlHelper.ExecuteNonQuery(CONNECTION_STRING,
    @"INSERT INTO `table1` (`col3`,`col4`) VALUES (@col3, @col4 );",
    (new List<MySqlParameter>() {
                new MySqlParameter("@col3", @"another value"),
                new MySqlParameter("@col4", @"some value")    
            }).ToArray()
    );

Now, imagine that I make the above call a few thousand times in async parallel tasks (via TPL).

There’s some max allowed connections on my MySQL server, and I start to get exceptions thrown claiming the user had exceeded max connections. I thought the connection pooling was suppose to handle this automatically for me? Isn’t the driver suppose to pool and queue them automatically for me?

I have 1500 max connections allowed currently, and I added this in my connection string:

Pooling=True;minimumPoolSize=0;maximumpoolsize=100;

Yet, I still get max connections exceeded. I need some advice with how to handle many async inserts without exploding this max connections limit.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-13T01:19:23+00:00Added an answer on June 13, 2026 at 1:19 am

    In addition to max_connections, the max_user_connections is what is important here. It can be queried for:

    show variables like 'max_user_connections';
    

    To avoid exceeding max connections for your MySQL user you’ll need to make sure the maximumpoolsize (in the connection string) is set to something lower than max_user_connections and that other apps are not opening connections with that same user account whose total could exceed the cap. So for example, I could set mine to 5 given I have a cap of 15.

    Capping this is very common by most hosting services to limit the resources you are using.

    Performing a larger batch of queries in a single connection could also be a viable workaround.

    In addition, sometimes hosts limit max_queries_per_hour and other such variables.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I've been reading a bit about Prepared statements with MySql, and the .NET/Connector does
I've been reading about mySQL DataSource and the ability to use mySQL with Entity
Reading about Django, I saw this: http://docs.djangoproject.com/en/1.1/ref/contrib/admin/#ref-contrib-admin - the fancy simple to use admin
Was just reading about different algos disassemblers use to identify binary as assembly instructions.
I've been reading up on the net about the issues with handling float and
I was reading a tutorial about how to connect android to mysql database over
I am using MySQL and Java to SELECT about 50000 records. The strange thing
I was reading about mysql transactions and I was under the impression that you
Reading about the Dispose pattern , I see the documentation repeatedly refer to cleaning
Reading about Kohana templates and saw something I've never seen before: $this->template->title = __('Welcome

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.