0

I have a parallel process that makes and closes many MySQL connections. Each process only makes one connection at any given time. Often times while mid-process (and a connection is not established) another external connection is made such that the process cannot connect because the maximum connections have been exceeded.

I want to know if there is a way to check-out or reserve connections for the duration of my process. The MySQL server I am accessing has a maximum allotted connections of 50, and my user can have 25, so I would like to "reserve" 25 connections.

Ideally, at the beginning of the process I would check for the number of connections available, and use either 25 (my user maximum) or the maximum available.

Jonathan Leffler
  • 730,956
  • 141
  • 904
  • 1,278
dayne
  • 7,504
  • 6
  • 38
  • 56
  • why don't you go for connection pooling.. it might help you. – Dhruv Kapatel Feb 09 '15 at 17:00
  • I am not familiar with connection pooling, but it sounds like it might be what I am trying to accomplish. I am connecting to the server using a DBI in R, and I am not sure if that would work (ie. how I would specify a pool). Can you be more specific? – dayne Feb 09 '15 at 17:11
  • Yeah... @dayne i would glad to help you but i am not familiar with DBI and R. Polling concept should be there as other languages have support for it. – Dhruv Kapatel Feb 09 '15 at 17:41

0 Answers0