louislivi / SMProxy

Swoole MySQL Proxy 一个基于 MySQL 协议,Swoole 开发的MySQL数据库连接池。 A MySQL database connection pool based on MySQL protocol and Swoole.
https://smproxy.louislivi.com
MIT License
1.78k stars 258 forks source link

docker 启动配置问题 #70

Closed bykiss closed 4 years ago

bykiss commented 4 years ago

Describe Your Environment (描述你的环境)

  1. 利用源码中的Dockerfile 安装
  2. maxConns或者maxSpareConns 设置为数字,比如"maxConns": 10 或者"maxConns": “10”
  3. maxConns或者maxSpareConns 设置为 swoole_cpu_num()/2

Expected Behavior (预期行为)

能正常启动

Actual Behavior (实际行为)

启动失败,日志显示 [warning] Invalid maxSpareConns or maxConns in writeSΜvulscan (phar:///usr/local/smproxy/SMProxy/src/MysqlPool/MySQLPool.php:63)

More Information (更多信息)

CPU为16核 当改回 swoole_cpu_num() 时,且只能为swoole_cpu_num() ,启动成功 ...

louislivi commented 4 years ago

maxConns或者maxSpareConns必须要大于worker_num因为worker_num默认为swoole_cpu_num(),你的cpu为16核,所以maxConnsmaxSpareConns必须要大于16,所以设置为10 或swoole_cpu_num()/2会出现该错误[warning] Invalid maxSpareConns or maxConns in XXX该错误。

bykiss commented 4 years ago

thx