首頁 美術繪圖 | 美術設計 | 熱門標籤 | 首選 | 首頁宣傳 | 近期作品 論壇: 發表 | 美術工作 | 美術比賽 | 展覽活動 | 美術相關 | 一般討論 | 美術同好 CG 討論 :: Photoshop | Painter | 3D 行動 | AMP

【 立即註冊 】 : 更改個人資料 : : 登入

會員名稱: 登入密碼: 保持登入

"Too many open files" in Google API "guzzle" guzzlehttp ConnectException.php

發表新主題 回覆主題 討論區 Windows, Linux, Perl, PHP, C/C++, Driver, Web 理論、應用、硬體、軟體

| 1頁, 共1
人氣點閱:5790 發表人
"Too many open files" in Google API "guzzle" guzzlehttp ConnectException.php 2023-03-05 00:50
/ / /

Possible Symptoms



代碼:


# You use compser to install Google Cloud API but you will see a lot of CLOSE_WAIT pending when doing "lsof" connect to "1e100.net"

# and then, these CLOSE_WAIT + (ESTABLISHED) will be exceed 1024

# Very likely you will see Too many open files.


$ lsof | grep -i '1e100.net'

php TCP YOUR_HOSTNAME:36144->nuq04s42-in-x0a.1e100.net:https (CLOSE_WAIT)
php TCP YOUR_HOSTNAME:36152->nuq04s42-in-x0a.1e100.net:https (CLOSE_WAIT)
php TCP YOUR_HOSTNAME:36156->nuq04s42-in-x0a.1e100.net:https (CLOSE_WAIT)
php TCP YOUR_HOSTNAME:36160->sfo03s24-in-x0a.1e100.net:https (CLOSE_WAIT)
php TCP YOUR_HOSTNAME:36160->sfo03s24-in-x0a.1e100.net:https (CLOSE_WAIT)



PHP Warning:  include(/YOUR-WORKING-FOLDER/vendor/guzzlehttp/guzzle/src/Exception/ConnectException.php): Failed to open stream: Too many open files in /YOUR-WORKING-FOLDER/vendor/composer/ClassLoader.php on line 571
PHP Warning:  include(): Failed opening '/YOUR-WORKING-FOLDER/vendor/composer/../guzzlehttp/guzzle/src/Exception/ConnectException.php' for inclusion (include_path='.:/usr/share/php') in /YOUR-WORKING-FOLDER/vendor/composer/ClassLoader.php on line 571
PHP Fatal error:  Uncaught Error: Class "GuzzleHttp\Exception\ConnectException" not found in /YOUR-WORKING-FOLDER/vendor/guzzlehttp/guzzle/src/Handler/CurlFactory.php:210


$ cat /proc/YOUR_SCRIPT_PID/limit | grep -i 'max open files'
✅ Max open files              1024               1024              files   





Workaround / Solution



Just increase the ulimit.

代碼:

$ vi /etc/security/limits.conf

# -------------------------------------
# ADD the following lines, increase the value from 1024 to "16384" or more
# -------------------------------------
*         hard    nofile      16384
*         soft    nofile      16384
root      hard    nofile      16384
root      soft    nofile      16384

$ reboot

$ cat /proc/YOUR_SCRIPT_PID/limit | grep -i 'max open files'
✅  Max open files            16384               16384              files   





etc-security-limits-conf (max open files).jpg
etc-security-limits-conf (max open files).jpg



________________

美術插畫設計案子報價系統 v0.1 Beta
爪哇禾雀
Type



繪圖畫廊設計藝廊
攝影相簿留言板
最愛收藏分類標籤
暱稱: Type
註冊: 2002-11-30
發表: 11165
來自: vovo2000.com
V幣: 901613





資訊相關理論、技術、管理、應用、產品等
發表新主題 回覆主題