Hi, I'm having the same issues @davidk01 had about 4 years ago
I'm making use of the multiprocessing package and I'm using a max of 5 Pools. I reduced the pool size to 1 in an attempt to reduce the overall number of processes but this clearly isn't the way to go. I keep getting this error:
Traceback (most recent call last):
File "/home/progen/.virtualenvs/progen/local/lib/python2.7/site-packages/flask/app.py", line 1817, in wsgi_app
response = self.full_dispatch_request()
File "/home/progen/.virtualenvs/progen/local/lib/python2.7/site-packages/flask/app.py", line 1477, in full_dispatch_request
rv = self.handle_user_exception(e)
File "/home/progen/.virtualenvs/progen/local/lib/python2.7/site-packages/flask/app.py", line 1381, in handle_user_exception
reraise(exc_type, exc_value, tb)
File "/home/progen/.virtualenvs/progen/local/lib/python2.7/site-packages/flask/app.py", line 1475, in full_dispatch_request
rv = self.dispatch_request()
File "/home/progen/.virtualenvs/progen/local/lib/python2.7/site-packages/flask/app.py", line 1461, in dispatch_request
return self.view_functions[rule.endpoint](**req.view_args)
File "/home/progen/pro-gen/api.py", line 67, in fetch_single_profile
data = {'data': executr.fetch_profile()}
File "/home/progen/pro-gen/scripts/executr.py", line 71, in fetch_profile
return fetch_multiprocessed_chunks(num_profiles)
File "/home/progen/pro-gen/scripts/executr.py", line 90, in fetch_multiprocessed_chunks
pool = Pool(pool_size)
File "/usr/lib/python2.7/multiprocessing/__init__.py", line 232, in Pool
return Pool(processes, initializer, initargs, maxtasksperchild)
File "/usr/lib/python2.7/multiprocessing/pool.py", line 177, in __init__
self._task_handler.start()
File "/usr/lib/python2.7/threading.py", line 745, in start
_start_new_thread(self.__bootstrap, ())
error: can't start new thread
-----------------------
Traceback (most recent call last):
File "/home/progen/.virtualenvs/progen/local/lib/python2.7/site-packages/flask/app.py", line 1817, in wsgi_app
response = self.full_dispatch_request()
File "/home/progen/.virtualenvs/progen/local/lib/python2.7/site-packages/flask/app.py", line 1477, in full_dispatch_request
rv = self.handle_user_exception(e)
File "/home/progen/.virtualenvs/progen/local/lib/python2.7/site-packages/flask/app.py", line 1381, in handle_user_exception
reraise(exc_type, exc_value, tb)
File "/home/progen/.virtualenvs/progen/local/lib/python2.7/site-packages/flask/app.py", line 1475, in full_dispatch_request
rv = self.dispatch_request()
File "/home/progen/.virtualenvs/progen/local/lib/python2.7/site-packages/flask/app.py", line 1461, in dispatch_request
return self.view_functions[rule.endpoint](**req.view_args)
File "/home/progen/pro-gen/api.py", line 55, in fetch_profiles
res.update({'data': executr.fetch_profile(profile_count)})
File "/home/progen/pro-gen/scripts/executr.py", line 71, in fetch_profile
return fetch_multiprocessed_chunks(num_profiles)
File "/home/progen/pro-gen/scripts/executr.py", line 90, in fetch_multiprocessed_chunks
pool = Pool(pool_size)
File "/usr/lib/python2.7/multiprocessing/__init__.py", line 232, in Pool
return Pool(processes, initializer, initargs, maxtasksperchild)
File "/usr/lib/python2.7/multiprocessing/pool.py", line 159, in __init__
self._repopulate_pool()
File "/usr/lib/python2.7/multiprocessing/pool.py", line 223, in _repopulate_pool
w.start()
File "/usr/lib/python2.7/multiprocessing/process.py", line 130, in start
self._popen = Popen(self)
File "/usr/lib/python2.7/multiprocessing/forking.py", line 121, in __init__
self.pid = os.fork()
OSError: [Errno 11] Resource temporarily unavailable
I'm not sure why I'm getting this error as this works fine locally.
I'd appreciate any help please.
Thanks.