fp7-ofelia / ocf

OFELIA Control Framework (OCF) is a set of software tools for testbed management.
http://fp7-ofelia.github.com/ocf/
Other
18 stars 14 forks source link

Django does not correctly close MySQL connections #177

Open CarolinaFernandez opened 10 years ago

CarolinaFernandez commented 10 years ago

While investigating a bit the source of the problems of the AMs that were disconnected after some time, we obtained the following from an OF AM:

Aggregate Manager *** was unreachable at [[ 08:47:03 PST ]] the cause 
was: <ProtocolError for xxx:yyy@zzz:www: 500 Internal Server Error>

After checking the opt-in manager log:

[Mon Nov 04 09:49:56 2013] [error] [client zzz] OperationalError: (1040, 
'Too many connections')

which is related to [1]

The maximum number of MySQL connections is 151 at a time. For some reason, Django ORM does not properly close these on opt-in manager.

To check how many connections are open in MySQL:

mysql> show processlist;

At this point there are at least two quick fixes:

(a) restart the mysql server daemon so as to flush the zombie connections (b) increase "max_connections" variable to some higher value, for example 200 (see [1])

[1] https://dev.mysql.com/doc/refman/5.5/en/too-many-connections.html

but we still need...

To search for a solution