ecairol
ecairol

Reputation: 6573

AMP Parallel: failed to open stream: Too many open files in ClassLoader.php

While using AMPHP libraries for thread working tasks, I suddenly got the Warning and Error:

PHP Warning:  include(/.../vendor/amphp/process/lib/ProcessException.php): failed to open stream: Too many open files in /.../vendor/composer/ClassLoader.php on line 445
PHP Fatal error:  Uncaught Error: Class 'Amp\Failure' not found

This was previously working fine, and started to get the issue recently.

Using:

Upvotes: 0

Views: 1472

Answers (1)

ecairol
ecairol

Reputation: 6573

According to a thread on AMPHP GitHub issue page: https://github.com/amphp/parallel-functions/issues/22

On macOS, the ulimit is by default 1024.

In my case, upgrading that to ulimit -n 4096 as suggested, worked fine.

According to IBM docs: "ulimit sets or displays the resource limits on processes created by the user." More info.

Upvotes: 0

Related Questions