[IPython-dev] ZMQError: Too many open files

dave.hirschfeld dave.hirschfeld at gmail.com
Tue Jan 10 15:56:11 EST 2012

I've been testing out the *awesome* parallel capabilities of the new
IPython but was continuously getting the "Too many open files"

  in __init__(self, url_or_file, profile, profile_dir, ipython_dir,
context, debug, exec_key, sshserver, sshkey, password, paramiko,
timeout, **extra_args)
    384         self._queue_handlers = {'execute_reply' :
    385                                 'apply_reply' :
--> 386         self._connect(sshserver, ssh_kwargs, timeout)
    388     def __del__(self):

  in _connect(self, sshserver, ssh_kwargs, timeout)

    516             if content.control:
--> 517                 self._control_socket = self._context.socket(zmq.DEALER)
    518                 self._control_socket.setsockopt(zmq.IDENTITY, ident)
    519                 connect_socket(self._control_socket, content.control)

  in zmq.core.context.Context.socket (zmq\core\context.c:1834)()

  in zmq.core.socket.Socket.__cinit__ (zmq\core\socket.c:2248)()

ZMQError: Too many open files

For my tests I was manually starting up 8 engines on up to 8 computers
and combining the results of thousands of monte-carlo simulations so I
was giving the parallel code a resonably decent stress test. All the
PCs are Win7 x64 boxes running 32bit Python 2.7.2.

Doing a bit of Googling I found the following:


Which seem to suggest the default TCP/IP parameters need to be changed
in the registry.
The attached .reg file will set the registry parameters shown below:

Windows Registry Editor Version 5.00


These changes can be applied manually or by double-clicking the attached file.

I'm not sure that this is the minimal set of changes necessary or even
the correct thing to do, but it has got rid of the ZMQError.

Hopefully this might help other windows users.

Dave Hirschfeld
-------------- next part --------------
A non-text attachment was scrubbed...
Name: tcp_parameters.reg
Type: application/octet-stream
Size: 602 bytes
Desc: not available
URL: <http://mail.python.org/pipermail/ipython-dev/attachments/20120110/d5afc753/attachment.obj>

More information about the IPython-dev mailing list