Tcp Server运行一段时间后内存就要爆了

服务器配置:8核16G的

tcpserver配置项: ··· 'tcp' => [ 'host' => '0.0.0.0', 'port' => 9502, 'setting' => [ 'heartbeat_check_interval' => 60,//心跳监测 'heartbeat_idle_time' => 120, 'daemonize' => 1,//守护进程 'log_file' => '/tmp/swoole/tcp_server.log', 'reactor_num' => 16, 'worker_num' => 64, 'task_worker_num' => 64, 'max_request' => 5000, 'open_eof_check' => true, //打开EOF检测 'package_eof' => "\r\n", //设置EOF 'max_conn' => 10000, //'open_eof_split' => true, ] ], ···

这是程序里加的一些统计,前面几个是通过stat方法获取的

··· { "start_time":1469610766, "connection_num":3644, "accept_count":29073, "close_count":25429, "tasking_num":0, "request_count":271941, "worker_request_count":3326, "counter_send_all":272204, "counter_login":11700, "counter_msg":74969, "counter_task_send":101308 } ···

这么多请求之后内存所剩无几

··· [root@VM_1_98_centos yoho-chat]# free -m total used free shared buffers cached Mem: 15948 15788 160 0 88 2070 -/+ buffers/cache: 13629 2319 Swap: 0 0 0 ···

手动reload服务内存也没有实质的释放,只有restart的时候内存剩余才回到12G

请问是代码里面有问题 还是配置项有问题?

2016-07-28 09:21
0

要回复问题请先登录注册