例外があります。すべての私は、プール・カウントにPythonマルチプロセッシング:プールサイズを大きくした後の壊れたパイプ例外
コード
def parse(url):
r = request.get(url)
POOL_COUNT = 75
with Pool(POOL_COUNT) as p:
result = p.map(parse, links)
File "/usr/lib64/python3.5/multiprocessing/pool.py", line 130, in worker
put((job, i, (False, wrapped)))
File "/usr/lib64/python3.5/multiprocessing/queues.py", line 355, in put
self._writer.send_bytes(obj)
File "/usr/lib64/python3.5/multiprocessing/connection.py", line 200, in send_bytes
self._send_bytes(m[offset:offset + size])
File "/usr/lib64/python3.5/multiprocessing/connection.py", line 404, in _send_bytes
self._send(header + buf)
File "/usr/lib64/python3.5/multiprocessing/connection.py", line 368, in _send
n = write(self._handle, buf)
BrokenPipeError: [Errno 32] Broken pipe
Process ForkPoolWorker-26:
Traceback (most recent call last):
File "/usr/lib64/python3.5/multiprocessing/pool.py", line 125, in worker
put((job, i, result))
File "/usr/lib64/python3.5/multiprocessing/queues.py", line 355, in put
self._writer.send_bytes(obj)
File "/usr/lib64/python3.5/multiprocessing/connection.py", line 200, in send_bytes
self._send_bytes(m[offset:offset + size])
File "/usr/lib64/python3.5/multiprocessing/connection.py", line 404, in _send_bytes
self._send(header + buf)
File "/usr/lib64/python3.5/multiprocessing/connection.py", line 368, in _send
n = write(self._handle, buf)
BrokenPipeError: [Errno 32] Broken pipe
私は試して複製するのに十分なコードを投稿できますか? –
インスタンス化されたプールの数を変更しますか?説明してください! 'map_async'を使うと、使用しているprocを数えずにプールを使うことができます:[例](https://stackoverflow.com/questions/4413821/multiprocessing-pool-example#4415314) – mquantin
@ XingzhouLiu質問は更新されました – Volatil3