centos7 django+nginx 环境下的网站经常性的出现:无法访问此网站 xxxxx.com 的响应时间太长。。。如图
然后出现这个提示后,自动刷新一下。就又打开网站了。而且速度很快打的开。
但是过了不久,不操作网站,再一刷新或打开网站又出现上图的提示。
这是 nginx 或什么环境没配置好吗? 需要从哪里入手查看原因? 谢谢。
1
Vegetable 2021-11-22 22:35:27 +08:00
是 mysql 吗,可以试试搜索关键字 django mysql 2006 gone away ,这个可能性比较高
|
2
python30 OP 详细报错图片,<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) ``` |
4
zachlhb 2021-11-23 09:28:58 +08:00 via iPhone
Django 用啥跑的,我用着没有问题啊
|
5
python30 OP @zachlhb centos+ nginx +uwsgi 以前也没有遇到这样的事。最近换了台 tx 的云服务器。就这样了。也查不到原因。
|
6
julyclyde 2021-11-23 12:50:45 +08:00
你这看起来是
浏览器-nginx 之间,建立 tcp 连接 超时 和 django 大概没什么关系 |
7
lybcyd 2021-11-23 13:41:27 +08:00
同意楼上,看现象连 nginx 的报错页面都没刷出来,说明是连接 nginx 的问题
|
8
python30 OP |
9
jmspark 2021-11-23 15:02:17 +08:00
曾经遇到过同样的问题,最后鸡贼的鹅厂说要使用按流量付费,结果就好了。
|
10
python30 OP @jmspark 是他们云服务器带宽的问题? 你现在一直用按流量付费? 奇怪的是我别的云服务器没这问题。一样的配置环境。
|