Distributions
› Ubuntu
› Fedora
› CentOS
中文资源站
› 网易开源镜像站
doufenger
V2EX  ›  Linux

我服务器 TCP 连接一直都是 10K 以上,人多的时候 20K,不大正常,要怎么调整环境呢

  •  
  •   doufenger · Oct 12, 2017 · 5494 views
    This topic created in 3313 days ago, the information mentioned may be changed or developed.

    之前一直是 2.5K 这样的,后来我做了点配置改变就变成这样了,现在我把调整的配置改回去了,还是这么高。

    Supplement 1  ·  Oct 12, 2017
    环境是这样:nginx+PHP5.6 的
    我改了 php-fpm.conf 的 request_terminate_timeout max_execution_time pm = static pm.max_children pm.max_requests request_terminate_timeout
    13 replies  •  2017-10-12 15:11:19 +08:00
    doufenger
    doufenger
    OP
    Oct 12, 2017
    1
    都是 ESTABLISHED 连接,有很多但 IP 连接数是 90 多的
    qianguozheng
    qianguozheng
    Oct 12, 2017
    2
    哪个服务?是不是服务出问题了
    topbandit
    topbandit
    Oct 12, 2017
    3
    需要调整内核参数了
    sagaxu
    sagaxu
    Oct 12, 2017
    4
    什么服务?改的什么配置?什么都不说,让人怎么给你参考。去医院看病,光说痛也不肯说哪里痛,呵呵。
    yunji334401
    yunji334401
    Oct 12, 2017
    5
    什么项目,这么高
    doufenger
    doufenger
    OP
    Oct 12, 2017
    6
    @sagaxu nginx+PHP5.6 的 我改了 php-fpm.conf 的 request_terminate_timeout max_execution_time pm = static pm.max_children pm.max_requests request_terminate_timeout
    opengps
    opengps
    Oct 12, 2017
    7
    这个级别,我只在我的 tcp 长连接 gps 系统中见过。web 项目不可能这么高吧
    opengps
    opengps
    Oct 12, 2017
    8
    你可以看看,延长连接释放周期,我感觉像是连接过早释放了导致的
    sagaxu
    sagaxu
    Oct 12, 2017
    9
    你可以区分一下,是用户跟 nginx 的连接数高,还是 nginx 跟 php 的连接数高
    doufenger
    doufenger
    OP
    Oct 12, 2017
    10
    @sagaxu 怎么区分这个呀
    zzlyzq
    zzlyzq
    Oct 12, 2017
    11
    nginx 和 php 之间没有用长链接么
    jyf
    jyf
    Oct 12, 2017
    12
    @opengps web 项目有这么多很正常 因为不光是 http 请求 比如还有 redis 数据库 队列之类的
    他这 php 环境貌似默认还有官方那个 memcache 缓存支持 也是要吃链接的
    doufenger
    doufenger
    OP
    Oct 12, 2017
    13
    @zzlyzq 可能没有吧 算了我找人服务帮弄弄看了
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Privacy   ·   Solana   ·   1682 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 35ms · UTC 05:20 · PVG 13:20 · LAX 21:20 · JFK 00:20
    ♥ Do have faith in what you're doing.