V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
推荐学习书目
Learn Python the Hard Way
Python Sites
PyPI - Python Package Index
http://diveintopython.org/toc/index.html
Pocoo
值得关注的项目
PyPy
Celery
Jinja2
Read the Docs
gevent
pyenv
virtualenv
Stackless Python
Beautiful Soup
结巴中文分词
Green Unicorn
Sentry
Shovel
Pyflakes
pytest
Python 编程
pep8 Checker
Styles
PEP 8
Google Python Style Guide
Code Style from The Hitchhiker's Guide
python30
V2EX  ›  Python

centos7 django+nginx 环境下的网站经常性的出现:无法访问此网站 xxxxx.com 的响应时间太长。。。如图

  •  1
     
  •   python30 · 2021-11-22 22:31:04 +08:00 · 2250 次点击
    这是一个创建于 1131 天前的主题,其中的信息可能已经有所发展或是发生改变。

    centos7 django+nginx 环境下的网站经常性的出现:无法访问此网站 xxxxx.com 的响应时间太长。。。如图

    然后出现这个提示后,自动刷新一下。就又打开网站了。而且速度很快打的开。

    但是过了不久,不操作网站,再一刷新或打开网站又出现上图的提示。

    这是 nginx 或什么环境没配置好吗? 需要从哪里入手查看原因? 谢谢。

    13 条回复    2021-11-25 09:32:10 +08:00
    Vegetable
        1
    Vegetable  
       2021-11-22 22:35:27 +08:00
    是 mysql 吗,可以试试搜索关键字 django mysql 2006 gone away ,这个可能性比较高
    python30
        2
    python30  
    OP
       2021-11-22 22:59:49 +08:00
    详细报错图片,<img src="https://z3.ax1x.com/2021/11/22/oSltoQ.png" />

    ```
    [pid: 20121|app: 0|req: 38761/40370] 127.0.0.1 () {40 vars in 744 bytes} [Mon Nov 22 33:77:17 2021] GET /user/login/?next=/user/15064305585/ => generated 2563 bytes in 9 msecs (HTTP/1.0 200) 6 headers in 437 bytes (1 switches on core 19)
    [pid: 20121|app: 0|req: 38762/40371] 127.0.0.1 () {42 vars in 781 bytes} [Mon Nov 22 33:77:17 2021] GET /info/7087 => generated 22924 bytes in 49 msecs (HTTP/1.0 200) 5 headers in 293 bytes (1 switches on core 27)
    [pid: 20121|app: 0|req: 38763/40372] 127.0.0.1 () {52 vars in 1151 bytes} [Mon Nov 22 33:77:18 2021] GET /daa/mip/info/894?ivk_sa=1024320u => generated 24539 bytes in 31 msecs (HTTP/1.0 200) 5 headers in 293 bytes (1 switches on core 18)
    [pid: 20121|app: 0|req: 38764/40373] 127.0.0.1 () {44 vars in 654 bytes} [Mon Nov 22 33:77:18 2021] GET /web/sidd/bb18753356065/ => generated 13356 bytes in 11 msecs (HTTP/1.0 200) 4 headers in 156 bytes (1 switches on core 5)
    [pid: 20121|app: 0|req: 38766/40374] 127.0.0.1 () {54 vars in 1181 bytes} [Mon Nov 22 33:77:18 2021] GET /dddda/info/1147?ivk_sa=1024320u => generated 23688 bytes in 145 msecs (HTTP/1.0 200) 5 headers in 293 bytes (1 switches on core 14)
    [pid: 20121|app: 0|req: 38766/40375] 127.0.0.1 () {52 vars in 1133 bytes} [Mon Nov 22 33:77:19 2021] GET /info/14380?ivk_sa=1024320u => generated 23758 bytes in 121 msecs (HTTP/1.0 200) 5 headers in 293 bytes (1 switches on core 2)
    [pid: 20121|app: 0|req: 38767/40376] 127.0.0.1 () {40 vars in 737 bytes} [Mon Nov 22 33:77:19 2021] GET /company/user_fav_list/hoffmann => generated 0 bytes in 1 msecs (HTTP/1.0 301) 3 headers in 137 bytes (1 switches on core 31)
    [pid: 20121|app: 0|req: 38769/40377] 127.0.0.1 () {42 vars in 677 bytes} [Mon Nov 22 33:77:20 2021] GET /daa/info/110 => generated 16577 bytes in 60 msecs (HTTP/1.0 200) 5 headers in 293 bytes (1 switches on core 26)
    [pid: 20121|app: 0|req: 38770/40378] 127.0.0.1 () {40 vars in 739 bytes} [Mon Nov 22 33:77:21 2021] GET /company/user_fav_list/hoffmann/ => generated 0 bytes in 1 msecs (HTTP/1.0 302) 5 headers in 186 bytes (1 switches on core 30)
    [pid: 20121|app: 0|req: 38770/40379] 127.0.0.1 () {40 vars in 591 bytes} [Mon Nov 22 33:77:20 2021] GET /m/info/49851 => generated 17855 bytes in 439 msecs (HTTP/1.0 200) 5 headers in 293 bytes (1 switches on core 11)
    [pid: 20121|app: 0|req: 38771/40380] 127.0.0.1 () {38 vars in 652 bytes} [Mon Nov 22 33:77:21 2021] GET /info/50540 => generated 18813 bytes in 94 msecs (HTTP/1.0 200) 5 headers in 293 bytes (1 switches on core 3)
    [pid: 20121|app: 0|req: 38772/40381] 127.0.0.1 () {40 vars in 686 bytes} [Mon Nov 22 33:77:22 2021] GET /news/m/?page=61 => generated 14787 bytes in 40 msecs (HTTP/1.0 200) 4 headers in 156 bytes (1 switches on core 1)
    [pid: 20121|app: 0|req: 38773/40382] 127.0.0.1 () {38 vars in 676 bytes} [Mon Nov 22 33:77:23 2021] GET /company/user_fav_list/PE_2009/ => generated 0 bytes in 1 msecs (HTTP/1.0 302) 5 headers in 185 bytes (1 switches on core 23)
    [pid: 20121|app: 0|req: 38774/40383] 127.0.0.1 () {40 vars in 701 bytes} [Mon Nov 22 33:77:23 2021] GET /dddda/info/10850 => generated 23618 bytes in 118 msecs (HTTP/1.0 200) 5 headers in 293 bytes (1 switches on core 20)
    [pid: 20121|app: 0|req: 38775/40384] 127.0.0.1 () {38 vars in 658 bytes} [Mon Nov 22 33:77:23 2021] GET /shen/info/7130 => generated 17684 bytes in 115 msecs (HTTP/1.0 200) 5 headers in 293 bytes (1 switches on core 24)
    [pid: 20121|app: 0|req: 38776/40385] 127.0.0.1 () {40 vars in 774 bytes} [Mon Nov 22 33:77:24 2021] GET /user/login/?next=/company/user_fav_list/hoffmann/ => generated 2563 bytes in 10 msecs (HTTP/1.0 200) 6 headers in 437 bytes (1 switches on core 9)
    [pid: 20121|app: 0|req: 38777/40386] 127.0.0.1 () {40 vars in 698 bytes} [Mon Nov 22 33:77:24 2021] GET /m/info/3673 => generated 17437 bytes in 31 msecs (HTTP/1.0 200) 5 headers in 293 bytes (1 switches on core 29)
    [pid: 20121|app: 0|req: 38778/40387] 127.0.0.1 () {42 vars in 689 bytes} [Mon Nov 22 33:77:56 2021] GET /mip/info/45956 => generated 21977 bytes in 110 msecs (HTTP/1.0 200) 3 headers in 111 bytes (1 switches on core 4)
    [pid: 20121|app: 0|req: 38779/40388] 127.0.0.1 () {42 vars in 805 bytes} [Mon Nov 22 33:77:56 2021] GET /shen/list/sxpd/?page=54 => generated 7865 bytes in 15 msecs (HTTP/1.0 200) 5 headers in 292 bytes (1 switches on core 12)
    [pid: 20121|app: 0|req: 38780/40389] 127.0.0.1 () {44 vars in 761 bytes} [Mon Nov 22 33:77:56 2021] GET /info/16317 => generated 18224 bytes in 74 msecs (HTTP/1.0 200) 5 headers in 293 bytes (1 switches on core 0)
    [pid: 20121|app: 0|req: 38781/40390] 127.0.0.1 () {38 vars in 653 bytes} [Mon Nov 22 33:77:26 2021] GET /web/sidd/bbDZQ129/ => generated 6594 bytes in 7 msecs (HTTP/1.0 200) 4 headers in 124 bytes (1 switches on core 22)
    [pid: 20121|app: 0|req: 38782/40391] 127.0.0.1 () {38 vars in 727 bytes} [Mon Nov 22 33:77:26 2021] GET /user/login/?next=%2Fcompany%2Fuser_fav_list%2FPE_2009%2F => generated 2563 bytes in 14 msecs (HTTP/1.0 200) 6 headers in 437 bytes (1 switches on core 7)
    [pid: 20121|app: 0|req: 38783/40392] 127.0.0.1 () {42 vars in 695 bytes} [Mon Nov 22 33:77:26 2021] GET /shen/mip/info/2666 => generated 56611 bytes in 83 msecs (HTTP/1.0 200) 5 headers in 293 bytes (1 switches on core 56)
    [pid: 20121|app: 0|req: 38784/40393] 127.0.0.1 () {52 vars in 2038 bytes} [Mon Nov 22 33:77:27 2021] GET /dddda/info/3173 => generated 23753 bytes in 134 msecs (HTTP/1.0 200) 5 headers in 293 bytes (1 switches on core 21)
    ```
    python30
        3
    python30  
    OP
       2021-11-22 23:00:31 +08:00
    @Vegetable 是的.mysql ,谢谢。我搜一下看看
    zachlhb
        4
    zachlhb  
       2021-11-23 09:28:58 +08:00 via iPhone
    Django 用啥跑的,我用着没有问题啊
    python30
        5
    python30  
    OP
       2021-11-23 10:46:19 +08:00
    @zachlhb centos+ nginx +uwsgi 以前也没有遇到这样的事。最近换了台 tx 的云服务器。就这样了。也查不到原因。
    julyclyde
        6
    julyclyde  
       2021-11-23 12:50:45 +08:00
    你这看起来是
    浏览器-nginx 之间,建立 tcp 连接 超时
    和 django 大概没什么关系
    lybcyd
        7
    lybcyd  
       2021-11-23 13:41:27 +08:00
    同意楼上,看现象连 nginx 的报错页面都没刷出来,说明是连接 nginx 的问题
    python30
        8
    python30  
    OP
       2021-11-23 14:47:07 +08:00
    @julyclyde
    @lybcyd
    如果是这种情况,怎么排查处理?如果只是我这台电脑有问题?那就不用管了。就怕是全部访问用户都会遇到。不知道是不是服务器上的问题。
    jmspark
        9
    jmspark  
       2021-11-23 15:02:17 +08:00
    曾经遇到过同样的问题,最后鸡贼的鹅厂说要使用按流量付费,结果就好了。
    python30
        10
    python30  
    OP
       2021-11-23 22:25:15 +08:00
    @jmspark 是他们云服务器带宽的问题? 你现在一直用按流量付费? 奇怪的是我别的云服务器没这问题。一样的配置环境。
    jmspark
        11
    jmspark  
       2021-11-24 14:00:39 +08:00
    @python30 是的,按流量付费。当时带宽上到 50 都不行,直接上到 100 就正常了。
    python30
        12
    python30  
    OP
       2021-11-24 20:48:21 +08:00
    @jmspark 莫非是流量大的时候才会出现这情况
    jmspark
        13
    jmspark  
       2021-11-25 09:32:10 +08:00
    @python30 是的
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   实用小工具   ·   2826 人在线   最高记录 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 22ms · UTC 13:13 · PVG 21:13 · LAX 05:13 · JFK 08:13
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.