socket.error 24: too many open files

Bryan Olson fakeaddress at nowhere.org
Wed Jan 7 19:06:02 EST 2009


TheDavidFactor wrote:
> [...] It's a deamon that runs on a linux box
> and every 15 seconds it checks a MySQL table for new records, if there
> are any it creates a .call file on the Asterisk server using ssh, it
> also checks the Asterisk server, again via ssh, for any finished calls
> and if there are any it reads the .call file and writes the result in
> to the MySQL table.
> 
> [...]  After it has run for an hour or so I get the error
> in the subject when the ssh class tries to create a new socket. I have
> double checked that it is closing the socket. I don't know what else
> to check, any suggestions would be much appreciated.

Is it possible you keep accumulating MySQLdb connection or cursor 
objects and don't close() them? (I don't know the innards of MySQLdb, 
but it's something to check.)

One thing you might try is to regularly log the filno() of your sockets.


-- 
--Bryan



More information about the Python-list mailing list