Note that there are some explanatory texts on larger screens.

plurals
  1. POHandle out of range in select
    primarykey
    data
    text
    <p>Many (>1000) workers (process) do some and want to save their work results in database. Result of work is JSON object. Workers produce JSON objects 1-5 per second. Database saver is separated process. Unidirectional connections for transfer JSON object from worker to saver is multiprocessing.Pipe. Number of pipes equal number of workers.</p> <p>In saver process periodically сall:</p> <pre><code>def recv_data(self): data = [] for pipe in self.data_pipe_pool: if pipe.poll(): data.append(pipe.recv()) return data </code></pre> <p>self.data_pipe_pool - list of pipes from workers.</p> <p>All work fine if i run ~100 workers. If i run >1000 workers i get exception:</p> <pre><code>2013-02-13T15:17:40.731429 Traceback (most recent call last): File "saver.py", line 44, in run profile = self.poll_data() File "saver.py", line 116, in poll_data ret = self.recv_data() File "saver_unit.py", line 127, in recv_data if pipe.poll(): IOError: handle out of range in select() </code></pre> <p>I know that this is due with <code>select()</code> call and that:</p> <blockquote> <p>FD_SETSIZE is usually defined to 1024 in GNU/Linux systems</p> </blockquote> <p>But where called <code>select</code>? If in <code>pipe.poll()</code>, why I exceed the FD_SETSIZE limit, i'm calling <code>pipe.poll()</code> for 1 pipe individually? Where can i watch python language sources with this call <code>select</code>?</p> <p>What workaround not exceed <code>FD_SETSIZE</code> limit or not use <code>select</code>?</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload