Guzzle send() method causes cURL error 35 Too many open files

后端 未结 1 1104
一个人的身影
一个人的身影 2021-01-26 06:20

Trying to execute the following code with Guzzle 5.

$client = new GuzzleClient([\'defaults/headers/User-Agent\' => static::$userAgentString]);

$request = $cl         


        
相关标签:
1条回答
  • 2021-01-26 07:05

    This is not an issue with Guzzle, or MailGun, so much as it is with your particular implementation of the libraries. You are actually hitting the limits of the underlying operating system (libcurl, openssl, and fopen) by having so many long running (open) requests.

    According to libcurl errors error 35 indicates that there was an error with the SSL/TLS handshake.

    According to various google references error: 02001018 is an indication that openssl was unable to access (or rather read) the certificate file.

    You are able to use ulimit to view and modify the limits various system-wide resources.

    You are also able to use lsof to view the open files.

    To resolve your issue:

    1. (if able) increase system resource allowances - be sure to research the implications that this change can have.
    2. Refactor your code so that you do not hit the operating environments limits. Perhaps it my be possible to use asynchronous communications for some of the requests. A different library, or perhaps "dropping down" and implementing your own.
    3. Find some way to implement some type of rate limiting (I have listed this separately from #2) but they could go hand in hand.
    0 讨论(0)
提交回复
热议问题