Max number of connections
Hi.
I've made little test for PySQLPool using Pool from multiprocessing:
----------
#!/usr/bin/env python
import PySQLPool
from multiprocessing import Pool
N = 20
c = PySQLPool.
def f(x):
q = PySQLPool.
counter = 0
for i in xrange(100):
counter = counter + q.Query('SELECT * FROM forms;')
return counter
if __name__ == '__main__':
p = Pool(N)
print p.map(f, xrange(N))
----------
This code working for N (number of processes) less about 160. If N bigger than 160 exception is raised:
_mysql_
QUESTION 1
I found "maxActiveConne
Why exception 'Too many connections' was raised only for 160+ parallel processes not for 10+?
QUESTION 2
Probably answer for first question is: only 10 or less processes was active in the same time, so only 10 or less connections was used. Ok, I've tried to increase "maxActiveConne
1. PySQLPool.
2. PySQLPool.
In case of both approaches, calling PySQLPool.
But I was surprised when exception was raised for the same value of N=160+ as in case of default value for maxActiveConnec
So the question is why changing of maxActiveConnec
Question information
- Language:
- English Edit question
- Status:
- Answered
- For:
- PySQLPool Edit question
- Assignee:
- Nikoleta Verbeck Edit question
- Last query:
- Last reply:
Can you help with this problem?
Provide an answer of your own, or ask Quasar for more information if necessary.