R
Railwayβ€’9mo ago
rom5031

Unable to add more gunicorn workers on Django project

Hey πŸ‘‹ Just upgraded to Pro, I wanted to add more gunicorn workers to get more capacity (going from 8 -> 16), but the additional workers are unable to start. Error message:
File "/usr/local/lib/python3.11/site-packages/sentry_sdk/worker.py", line 70, in start
self._thread.start()
File "/usr/local/lib/python3.11/site-packages/sentry_sdk/integrations/threading.py", line 56, in sentry_start
return old_start(self, *a, **kw)
^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/threading.py", line 964, in start
_start_new_thread(self._bootstrap, ())
RuntimeError: can't start new thread
OpenBLAS blas_thread_init: pthread_create failed for thread 1 of 32: Resource temporarily unavailable
OpenBLAS blas_thread_init: RLIMIT_NPROC -1 current, -1 max
File "/usr/local/lib/python3.11/site-packages/sentry_sdk/worker.py", line 70, in start
self._thread.start()
File "/usr/local/lib/python3.11/site-packages/sentry_sdk/integrations/threading.py", line 56, in sentry_start
return old_start(self, *a, **kw)
^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/threading.py", line 964, in start
_start_new_thread(self._bootstrap, ())
RuntimeError: can't start new thread
OpenBLAS blas_thread_init: pthread_create failed for thread 1 of 32: Resource temporarily unavailable
OpenBLAS blas_thread_init: RLIMIT_NPROC -1 current, -1 max
It runs fine locally, any hint? Thanks in advance !
Solution:
Fixed by adding os.environ['OPENBLAS_NUM_THREADS'] = '1' on app start (from https://stackoverflow.com/a/57549064), not sure why it works 🀷
Jump to solution
3 Replies
Percy
Percyβ€’9mo ago
Project ID: 946c760b-c58f-4c9a-98b8-b3fe1d360c6c
rom5031
rom5031OPβ€’9mo ago
946c760b-c58f-4c9a-98b8-b3fe1d360c6c
Solution
rom5031
rom5031β€’9mo ago
Fixed by adding os.environ['OPENBLAS_NUM_THREADS'] = '1' on app start (from https://stackoverflow.com/a/57549064), not sure why it works 🀷
Want results from more Discord servers?
Add your server