首页
下载
文档
社区
视频
捐赠
源代码
赞助商
AOT 编译器
AI 助理
商业产品
PHP AOT 原生编译器
Swoole-Compiler 代码加密器
CRMEB 新零售社交电商系统
登录
注册
全部
提问
分享
讨论
建议
公告
开发框架
CodeGalaxy
发表新帖
EPOLLIN handle failed
### 问题描述 swoole运行一段时间后报 WARNING wait(:222): EPOLLIN handle failed. fd=11, Error: Resource temporarily unavailable[11] 批量出现 ### Swoole版本,PHP版本,以及操作系统版本信息 php 7.2.34 swoole 4.6.4 ubantu5.4.0-42 ### 相关代码 ```php ``` ### 你期待的结果是什么?实际看到的错误信息又是什么?
发布于5年前 · 6 次浏览 · 来自
提问
iwaite
### 问题描述 swoole运行一段时间后报 WARNING wait(:222): EPOLLIN handle failed. fd=11, Error: Resource temporarily unavailable[11] 批量出现 ### Swoole版本,PHP版本,以及操作系统版本信息 php 7.2.34 swoole 4.6.4 ubantu5.4.0-42 ### 相关代码 ```php ``` ### 你期待的结果是什么?实际看到的错误信息又是什么?
赞
0
收藏
提问
分享
讨论
建议
公告
开发框架
CodeGalaxy
登录
后参与评论
评论
2021-05-24
鲁飞
https://wiki.swoole.com/#/question/use?id=resource-temporarily-unavailable-11
赞
0
回复
2021-05-27
iwaite
回复
鲁飞
最近我又观察了这个情况 应该不是您说的原因 因为每次push消息之前都会检查 isEstablished 成功的才会push 这些批量报错的东西的fd都不在我自己存起来的fd列表中 我自己存的fd都是几万开头的 而这些报错的都是 7、9、11、13奇数位的 报错时间间隔和心跳一致 都是30秒
赞
0
回复
2021-08-16
z
zeicool
回复
鲁飞
  几乎每秒都会有几次这种记录,fid=7 fid=33 fid=35都有,只是在larave里配置了laravels,还没有使用swoole代码,现在是8月份,系统日期是正确的,但是这个日志的名字是swoole-2021-06.log,laravels配置文件只改了最大请求为1,其它没改过,不知道是哪的问题 <?php return [ /* |-------------------------------------------------------------------------- | LaravelS Settings |-------------------------------------------------------------------------- | | English https://github.com/hhxsv5/laravel-s/blob/master/Settings.md#laravels-settings | Chinese https://github.com/hhxsv5/laravel-s/blob/master/Settings-CN.md#laravels-%E9%85%8D%E7%BD%AE%E9%A1%B9 | */ /* |-------------------------------------------------------------------------- | The IP address of the server |-------------------------------------------------------------------------- | | IPv4: use "127.0.0.1" to listen local address, and "0.0.0.0" to listen all addresses. | IPv6: use "::1" to listen local address, and "::"(equivalent to 0:0:0:0:0:0:0:0) to listen all addresses. | */ 'listen_ip' => env('LARAVELS_LISTEN_IP', '127.0.0.1'), /* |-------------------------------------------------------------------------- | The port of the server |-------------------------------------------------------------------------- | | Require root privilege if port is less than 1024. | */ 'listen_port' => env('LARAVELS_LISTEN_PORT', 5200), /* |-------------------------------------------------------------------------- | The socket type of the server |-------------------------------------------------------------------------- | | Usually, you don’t need to care about it. | Unless you want Nginx to proxy to the UnixSocket Stream file, you need | to modify it to SWOOLE_SOCK_UNIX_STREAM, and listen_ip is the path of UnixSocket Stream file. | List of socket types: | SWOOLE_SOCK_TCP: TCP | SWOOLE_SOCK_TCP6: TCP IPv6 | SWOOLE_SOCK_UDP: UDP | SWOOLE_SOCK_UDP6: UDP IPv6 | SWOOLE_UNIX_DGRAM: Unix socket dgram | SWOOLE_UNIX_STREAM: Unix socket stream | Enable SSL: $sock_type | SWOOLE_SSL. To enable SSL, check the configuration about SSL. | https://www.swoole.co.uk/docs/modules/swoole-server-doc | https://www.swoole.co.uk/docs/modules/swoole-server/configuration | */ 'socket_type' => defined('SWOOLE_SOCK_TCP') ? SWOOLE_SOCK_TCP : 1, /* |-------------------------------------------------------------------------- | Server Name |-------------------------------------------------------------------------- | | This value represents the name of the server that will be | displayed in the header of each request. | */ 'server' => env('LARAVELS_SERVER', 'LaravelS'), /* |-------------------------------------------------------------------------- | Handle Static Resource |-------------------------------------------------------------------------- | | Whether handle the static resource by LaravelS(Require Swoole >= 1.7.21, Handle by Swoole if Swoole >= 1.9.17). | Suggest that Nginx handles the statics and LaravelS handles the dynamics. | The default path of static resource is base_path('public'), you can modify swoole.document_root to change it. | */ 'handle_static' => env('LARAVELS_HANDLE_STATIC', false), /* |-------------------------------------------------------------------------- | Laravel Base Path |-------------------------------------------------------------------------- | | The basic path of Laravel, default base_path(), be used for symbolic link. | */ 'laravel_base_path' => env('LARAVEL_BASE_PATH', base_path()), /* |-------------------------------------------------------------------------- | Inotify Reload |-------------------------------------------------------------------------- | | This feature requires inotify extension. | https://github.com/hhxsv5/laravel-s#automatically-reload-after-modifying-code | */ 'inotify_reload' => [ // Whether enable the Inotify Reload to reload all worker processes when your code is modified. 'enable' => env('LARAVELS_INOTIFY_RELOAD', false), // The file path that Inotify watches 'watch_path' => base_path(), // The file types that Inotify watches 'file_types' => ['.php'], // The excluded/ignored directories that Inotify watches 'excluded_dirs' => [], // Whether output the reload log 'log' => true, ], /* |-------------------------------------------------------------------------- | Swoole Event Handlers |-------------------------------------------------------------------------- | | Configure the event callback function of Swoole, key-value format, | key is the event name, and value is the class that implements the event | processing interface. | | https://github.com/hhxsv5/laravel-s#configuring-the-event-callback-function-of-swoole | */ 'event_handlers' => [], /* |-------------------------------------------------------------------------- | WebSockets |-------------------------------------------------------------------------- | | Swoole WebSocket Server settings. | | https://github.com/hhxsv5/laravel-s#enable-websocket-server | */ 'websocket' => [ 'enable' => false, // 'handler' => XxxWebSocketHandler::class, ], /* |-------------------------------------------------------------------------- | Sockets - multi-port mixed protocol |-------------------------------------------------------------------------- | | The socket(port) list for TCP/UDP. | | https://github.com/hhxsv5/laravel-s#multi-port-mixed-protocol | */ 'sockets' => [], /* |-------------------------------------------------------------------------- | Custom Process |-------------------------------------------------------------------------- | | Support developers to create custom processes for monitoring, | reporting, or other special tasks. | | https://github.com/hhxsv5/laravel-s#custom-process | */ 'processes' => [], /* |-------------------------------------------------------------------------- | Timer |-------------------------------------------------------------------------- | | Wrapper cron job base on Swoole's Millisecond Timer, replace Linux Crontab. | | https://github.com/hhxsv5/laravel-s#millisecond-cron-job | */ 'timer' => [ 'enable' => env('LARAVELS_TIMER', false), // The list of cron job 'jobs' => [ // Enable LaravelScheduleJob to run `php artisan schedule:run` every 1 minute, replace Linux Crontab // Hhxsv5\LaravelS\Illuminate\LaravelScheduleJob::class, ], // Max waiting time of reloading 'max_wait_time' => 5, // Enable the global lock to ensure that only one instance starts the timer // when deploying multiple instances. // This feature depends on Redis https://laravel.com/docs/8.x/redis 'global_lock' => false, 'global_lock_key' => config('app.name', 'Laravel'), ], /* |-------------------------------------------------------------------------- | Swoole Tables |-------------------------------------------------------------------------- | | All defined tables will be created before Swoole starting. | | https://github.com/hhxsv5/laravel-s#use-swooletable | */ 'swoole_tables' => [], /* |-------------------------------------------------------------------------- | Re-register Providers |-------------------------------------------------------------------------- | | The Service Provider list, will be re-registered each request, and run method boot() | if it exists. Usually, be used to clear the Service Provider | which registers Singleton instances. | | https://github.com/hhxsv5/laravel-s/blob/master/Settings.md#register_providers | */ 'register_providers' => [], /* |-------------------------------------------------------------------------- | Cleaners |-------------------------------------------------------------------------- | | The list of cleaners for each request is used to clean up some residual | global variables, singleton objects, and static properties to avoid | data pollution between requests. | | https://github.com/hhxsv5/laravel-s/blob/master/Settings.md#cleaners | */ 'cleaners' => [ Hhxsv5\LaravelS\Illuminate\Cleaners\SessionCleaner::class, // 如果你的项目中使用到了Session或Authentication Hhxsv5\LaravelS\Illuminate\Cleaners\AuthCleaner::class, // 如果你的项目中使用到了Authentication或Passport ], /* |-------------------------------------------------------------------------- | Destroy Controllers |-------------------------------------------------------------------------- | | Automatically destroy the controllers after each request to solve | the problem of the singleton controllers. | | https://github.com/hhxsv5/laravel-s/blob/master/KnownIssues.md#singleton-controller | */ 'destroy_controllers' => [ 'enable' => false, 'excluded_list' => [], ], /* |-------------------------------------------------------------------------- | Swoole Settings |-------------------------------------------------------------------------- | | Swoole's original configuration items. | | More settings | Chinese https://wiki.swoole.com/#/server/setting | English https://www.swoole.co.uk/docs/modules/swoole-server/configuration | */ 'swoole' => [ 'daemonize' => env('LARAVELS_DAEMONIZE', false), 'dispatch_mode' => env('LARAVELS_DISPATCH_MODE', 2), 'reactor_num' => env('LARAVELS_REACTOR_NUM', function_exists('swoole_cpu_num') ? swoole_cpu_num() : 8), 'worker_num' => env('LARAVELS_WORKER_NUM', function_exists('swoole_cpu_num') ? swoole_cpu_num() * 4 : 8), //'task_worker_num' => env('LARAVELS_TASK_WORKER_NUM', function_exists('swoole_cpu_num') ? swoole_cpu_num() * 4 : 8), 'task_ipc_mode' => 1, 'task_max_request' => env('LARAVELS_TASK_MAX_REQUEST', 100000),//100000 'task_tmpdir' => @is_writable('/dev/shm/') ? '/dev/shm' : '/tmp', 'max_request' => env('LARAVELS_MAX_REQUEST', 1),//100000 'open_tcp_nodelay' => true, 'pid_file' => storage_path('laravels.pid'), 'log_level' => 4, 'log_file' => storage_path(sprintf('logs/swoole-%s.log', date('Y-m'))), 'document_root' => base_path('public'), 'buffer_output_size' => 2 * 1024 * 1024, 'socket_buffer_size' => 8 * 1024 * 1024, 'package_max_length' => 4 * 1024 * 1024, 'reload_async' => true, 'max_wait_time' => 60, 'enable_reuse_port' => true, 'enable_coroutine' => false, 'upload_tmp_dir' => @is_writable('/dev/shm/') ? '/dev/shm' : '/tmp', 'http_compression' => false, ], ];
赞
0
回复
2021-05-27
iwaite
[2021-05-27 07:55:21 #1787127.1] WARNING wait(:222): EPOLLIN handle failed. fd=13, Error: Resource temporarily unavailable[11] [2021-05-27 07:55:21 #1787127.0] WARNING wait(:222): EPOLLIN handle failed. fd=7, Error: Success[0] [2021-05-27 07:55:21 #1787127.0] WARNING wait(:222): EPOLLIN handle failed. fd=11, Error: Success[0] 不只有Resource temporarily unavailable 还有Error: Success[0]
赞
0
回复
2021-06-03
White
回复
iwaite
鲁飞回复的是客户端,你这个应该也是服务端的问题吧? 我也有,很长时间了,而且一旦出现的话就是死循环,每隔一两分钟就会来一次。我的代码里面没有客户端的使用,所以肯定的服务端的问题
赞
0
回复