Selenium BlockingIOError: [Errno 11] Resource temporarily unavailable

I am running several browsers in separate threads with help of selenium 4.2.0 (FireFox) and celery in docker container.

Program is working fine, but for significant amount of data I have an error (see trace below)

I read about the error https://www.pythonanywhere.com/forums/topic/1298/
Looks like it deals with breach of OS limit.

How to understand reason of the error and ways to fix it?

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
<code>Traceback (most recent call last):
celery-1 | File "/project/parser_app/celery_tasks.py", line 221, in check_urls
celery-1 | parser = YandexParser()
celery-1 | File "/project/parser_app/parser/common.py", line 195, in __init__
celery-1 | self.driver = get_firefox_driver(proxy_data=proxy_data)
celery-1 | File "/project/parser_app/parser/common.py", line 79, in get_firefox_driver
celery-1 | driver = webdriver.Firefox(options=options, seleniumwire_options=proxy_options, firefox_profile=firefox_profile)
celery-1 | File "/usr/local/lib/python3.9/site-packages/seleniumwire/webdriver.py", line 179, in __init__
celery-1 | super().__init__(*args, **kwargs)
celery-1 | File "/usr/local/lib/python3.9/site-packages/selenium/webdriver/firefox/webdriver.py", line 172, in __init__
celery-1 | self.service.start()
celery-1 | File "/usr/local/lib/python3.9/site-packages/selenium/webdriver/common/service.py", line 71, in start
celery-1 | self.process = subprocess.Popen(cmd, env=self.env,
celery-1 | File "/usr/local/lib/python3.9/subprocess.py", line 951, in __init__
celery-1 | self._execute_child(args, executable, preexec_fn, close_fds,
celery-1 | File "/usr/local/lib/python3.9/subprocess.py", line 1770, in _execute_child
celery-1 | self.pid = _posixsubprocess.fork_exec(
celery-1 | BlockingIOError: [Errno 11] Resource temporarily unavailable
</code>
<code>Traceback (most recent call last): celery-1 | File "/project/parser_app/celery_tasks.py", line 221, in check_urls celery-1 | parser = YandexParser() celery-1 | File "/project/parser_app/parser/common.py", line 195, in __init__ celery-1 | self.driver = get_firefox_driver(proxy_data=proxy_data) celery-1 | File "/project/parser_app/parser/common.py", line 79, in get_firefox_driver celery-1 | driver = webdriver.Firefox(options=options, seleniumwire_options=proxy_options, firefox_profile=firefox_profile) celery-1 | File "/usr/local/lib/python3.9/site-packages/seleniumwire/webdriver.py", line 179, in __init__ celery-1 | super().__init__(*args, **kwargs) celery-1 | File "/usr/local/lib/python3.9/site-packages/selenium/webdriver/firefox/webdriver.py", line 172, in __init__ celery-1 | self.service.start() celery-1 | File "/usr/local/lib/python3.9/site-packages/selenium/webdriver/common/service.py", line 71, in start celery-1 | self.process = subprocess.Popen(cmd, env=self.env, celery-1 | File "/usr/local/lib/python3.9/subprocess.py", line 951, in __init__ celery-1 | self._execute_child(args, executable, preexec_fn, close_fds, celery-1 | File "/usr/local/lib/python3.9/subprocess.py", line 1770, in _execute_child celery-1 | self.pid = _posixsubprocess.fork_exec( celery-1 | BlockingIOError: [Errno 11] Resource temporarily unavailable </code>
Traceback (most recent call last):
celery-1         |   File "/project/parser_app/celery_tasks.py", line 221, in check_urls
celery-1         |     parser = YandexParser()
celery-1         |   File "/project/parser_app/parser/common.py", line 195, in __init__
celery-1         |     self.driver = get_firefox_driver(proxy_data=proxy_data)
celery-1         |   File "/project/parser_app/parser/common.py", line 79, in get_firefox_driver
celery-1         |     driver = webdriver.Firefox(options=options, seleniumwire_options=proxy_options, firefox_profile=firefox_profile)
celery-1         |   File "/usr/local/lib/python3.9/site-packages/seleniumwire/webdriver.py", line 179, in __init__
celery-1         |     super().__init__(*args, **kwargs)
celery-1         |   File "/usr/local/lib/python3.9/site-packages/selenium/webdriver/firefox/webdriver.py", line 172, in __init__
celery-1         |     self.service.start()
celery-1         |   File "/usr/local/lib/python3.9/site-packages/selenium/webdriver/common/service.py", line 71, in start
celery-1         |     self.process = subprocess.Popen(cmd, env=self.env,
celery-1         |   File "/usr/local/lib/python3.9/subprocess.py", line 951, in __init__
celery-1         |     self._execute_child(args, executable, preexec_fn, close_fds,
celery-1         |   File "/usr/local/lib/python3.9/subprocess.py", line 1770, in _execute_child
celery-1         |     self.pid = _posixsubprocess.fork_exec(
celery-1         | BlockingIOError: [Errno 11] Resource temporarily unavailable

I checked number of avaliable threads

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
<code>cat /proc/sys/kernel/pid_max
4194304
</code>
<code>cat /proc/sys/kernel/pid_max 4194304 </code>
cat /proc/sys/kernel/pid_max
4194304

Also checked number of zombie processes

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
<code>ps aux | awk '$8 ~ /^[Zz]/' | wc -l
35990
</code>
<code>ps aux | awk '$8 ~ /^[Zz]/' | wc -l 35990 </code>
ps aux | awk '$8 ~ /^[Zz]/' | wc -l
35990

And disk free space

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
<code>~/new_app$ df -h --total
Filesystem Size Used Avail Use% Mounted on
udev 16G 0 16G 0% /dev
tmpfs 3.2G 1004K 3.2G 1% /run
/dev/sda2 9.8G 3.3G 6.0G 36% /
tmpfs 16G 0 16G 0% /dev/shm
tmpfs 5.0M 0 5.0M 0% /run/lock
/dev/sdb 100G 5.1G 95G 6% /data
tmpfs 3.2G 0 3.2G 0% /run/user/1001
total 148G 8.4G 139G 6% -
</code>
<code>~/new_app$ df -h --total Filesystem Size Used Avail Use% Mounted on udev 16G 0 16G 0% /dev tmpfs 3.2G 1004K 3.2G 1% /run /dev/sda2 9.8G 3.3G 6.0G 36% / tmpfs 16G 0 16G 0% /dev/shm tmpfs 5.0M 0 5.0M 0% /run/lock /dev/sdb 100G 5.1G 95G 6% /data tmpfs 3.2G 0 3.2G 0% /run/user/1001 total 148G 8.4G 139G 6% - </code>
~/new_app$ df -h --total
Filesystem      Size  Used Avail Use% Mounted on
udev             16G     0   16G   0% /dev
tmpfs           3.2G 1004K  3.2G   1% /run
/dev/sda2       9.8G  3.3G  6.0G  36% /
tmpfs            16G     0   16G   0% /dev/shm
tmpfs           5.0M     0  5.0M   0% /run/lock
/dev/sdb        100G  5.1G   95G   6% /data
tmpfs           3.2G     0  3.2G   0% /run/user/1001
total           148G  8.4G  139G   6% -

Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa Dịch vụ tổ chức sự kiện 5 sao Thông tin về chúng tôi Dịch vụ sinh nhật bé trai Dịch vụ sinh nhật bé gái Sự kiện trọn gói Các tiết mục giải trí Dịch vụ bổ trợ Tiệc cưới sang trọng Dịch vụ khai trương Tư vấn tổ chức sự kiện Hình ảnh sự kiện Cập nhật tin tức Liên hệ ngay Thuê chú hề chuyên nghiệp Tiệc tất niên cho công ty Trang trí tiệc cuối năm Tiệc tất niên độc đáo Sinh nhật bé Hải Đăng Sinh nhật đáng yêu bé Khánh Vân Sinh nhật sang trọng Bích Ngân Tiệc sinh nhật bé Thanh Trang Dịch vụ ông già Noel Xiếc thú vui nhộn Biểu diễn xiếc quay đĩa Dịch vụ tổ chức tiệc uy tín Khám phá dịch vụ của chúng tôi Tiệc sinh nhật cho bé trai Trang trí tiệc cho bé gái Gói sự kiện chuyên nghiệp Chương trình giải trí hấp dẫn Dịch vụ hỗ trợ sự kiện Trang trí tiệc cưới đẹp Khởi đầu thành công với khai trương Chuyên gia tư vấn sự kiện Xem ảnh các sự kiện đẹp Tin mới về sự kiện Kết nối với đội ngũ chuyên gia Chú hề vui nhộn cho tiệc sinh nhật Ý tưởng tiệc cuối năm Tất niên độc đáo Trang trí tiệc hiện đại Tổ chức sinh nhật cho Hải Đăng Sinh nhật độc quyền Khánh Vân Phong cách tiệc Bích Ngân Trang trí tiệc bé Thanh Trang Thuê dịch vụ ông già Noel chuyên nghiệp Xem xiếc khỉ đặc sắc Xiếc quay đĩa thú vị
Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa
Thiết kế website Thiết kế website Thiết kế website Cách kháng tài khoản quảng cáo Mua bán Fanpage Facebook Dịch vụ SEO Tổ chức sinh nhật