通知短信+运营短信,5秒速达,支持群发助手一键发送🚀高效触达和通知客户 广告
# server.php 服务器基础配置 ```php /** * 服务器设置 */ $config['server']['send_use_task_num'] = 20; $config['server']['set'] = [ 'log_file' => LOG_DIR."/swoole.log", 'log_level' => 5, 'reactor_num' => 2, //reactor thread num 'worker_num' => 4, //worker process num 'backlog' => 128, //listen backlog 'open_tcp_nodelay' => 1, 'dispatch_mode' => 5, 'task_worker_num' => 5, 'task_max_request' => 5000, 'enable_reuse_port' => true, 'heartbeat_idle_time' => 120,//2分钟后没消息自动释放连接 'heartbeat_check_interval' => 60,//1分钟检测一次 'max_connection' => 100000 ]; //协程超时时间 $config['coroution']['timerOut'] = 5000; //是否启用自动reload $config['auto_reload_enable'] = true; ``` 这里set中的max_connection是设置服务器最大连接数,如果超过则会拒绝。 max_connection越大申请的内存越大,运行时可能会报错,那么需要调整下面的参数。 ulimit -n 要调整为100000甚至更大。 命令行下执行 ulimit -n 100000即可修改。如果不能修改,需要设置 /etc/security/limits.conf,加入 ``` * soft nofile 262140 * hard nofile 262140 root soft nofile 262140 root hard nofile 262140 * soft core unlimited * hard core unlimited root soft core unlimited root hard core unlimited ``` 注意,修改limits.conf文件后,需要重启系统生效。