Codexshaper / laravel-woocommerce

WooCommerce Rest API for Laravel
MIT License
189 stars 59 forks source link

cURL Error: getaddrinfo() thread failed to start #88

Open itpilotdk opened 1 year ago

itpilotdk commented 1 year ago

When creating a lot (>1000) products with categories, variations and attributes, i run into an error, where the system is out of inodes.

I can reproduce the issue both when running the jobs as an artisan command in linux (takes a few hours), or when running in production as a systemd service.

The (linux) server runs out of inodes. Default system setting is 1024 inodes.

See: https://github.com/guzzle/guzzle/issues/1977 image

Temp solution (not a fix) Raise the inode limits in : /etc/security/limits.conf (ubuntu 22.04 server)

* hard nofile 500000 * soft nofile 500000 root hard nofile 500000 root soft nofile 500000

itpilotdk commented 1 year ago

Another scenario still didn't work in some configurations. We also had to change /etc/systemd/system.conf (child processes didn't inherit the overwritten nofile setting.)

DefaultLimitNOFILE=500000:524288

In addition, this also helps the problem (--max-jobs to kill the process often giving it a new process id, and new limits

[program:laravel-worker] process_name=%(program_name)s_%(process_num)02d command=php artisan queue:work --sleep=5 --tries=1 --max-jobs 5 autostart=true autorestart=true stopasgroup=true killasgroup=true user=www-data numprocs=3 stopwaitsecs=7200 startsecs=0