ershoes 发表于 2012-6-2 10:45:59

新加了一个域名出现499,无法访问

服务器上新绑定一个域名出现499错误,网站无法访问,但是用老域名可以访问,不知道是机房白名单问题还是nginx配置问题。求解!!

hong0 发表于 2012-6-3 12:13:53

首先我先google了半天499错误,得到的结果如下:
499对应的是 “client has closed connection”。这很有可能是因为服务器端处理的时间过长,客户端“不耐烦”了。要解决此问题,就需要在程序上面做些优化了。
复制代码

http://www.blogkid.net/archives/2582.html

发现可能是程序的问题,然后开始查看网站日志跟mysql慢查询日志:
nginx网站日志:
218.244.176.75 - - "GET /api/uc.php?app=category_other_site&act=school&datatype=serialize&catid=0,10100,13161&limit=9 HTTP/1.1" 200 1034 "-" "PHP/5.2.9"
220.181.94.219 - - "GET /portal/courseListChangePage_305449_2.html HTTP/1.1" 302 203 "-" "Sogou web spider/4.0(+http://www.sogou.com/docs/help/webmasters.htm#07)"
220.181.94.236 - - "GET /viewthread.php?tid=26192 HTTP/1.1" 302 203 "-" "Sogou web spider/4.0(+http://www.sogou.com/docs/help/webmasters.htm#07)"
211.151.93.14 - - "GET /caiwuguanli/407610/ HTTP/1.1" 499 0 "-" "-"
211.151.93.14 - - "GET /296059/ HTTP/1.1" 499 0 "-" "-"
211.151.93.14 - - "GET /renliziyuan/404515/ HTTP/1.1" 499 0 "-" "-"
复制代码

mysql慢查询日志:
# Time: 100327 12:48:40
# User@Host: master @
# Query_time: 0.629562Lock_time: 0.000109 Rows_sent: 5Rows_examined: 356982
SET timestamp=1269665320;
SELECT g.course_id,abs(is_lost-1) as is_lost FROM ***_goods_fields g LEFT JOIN ***_course c ON g.course_id=c.course_id LEFT JOIN ***_store s ON g.store_id=s.store_idWHERE c.status = 1 AND s.state =4GROUP BY g.course_idORDER BY s.sgrade_weight DESC,s.certification DESC,is_lost ASC,c.first DESC,c.update_date DESC limit 0,5;
# User@Host: master @
# Query_time: 0.006317Lock_time: 0.000029 Rows_sent: 1Rows_examined: 25318
SET timestamp=1269665320;
SELECT count(*) FROM ***_sessions WHERE expiry >=1269665320;
# Time: 100327 12:48:43
# User@Host: master @
# Query_time: 0.008097Lock_time: 0.000040 Rows_sent: 1Rows_examined: 25318
SET timestamp=1269665323;
SELECT count(*) FROM ***_sessions WHERE expiry >=1269665323;
复制代码

询问开发人员发现是session的表有问题,在每次baidu跟google等来抓取的时候,session经常出问题,找到问题就提交给开发人员去处理了!

哈哈,运维排错任务到此完成!

mysql开启慢查询参考:
http://bbs.linuxtone.org/viewthread.php?tid=199
页: [1]
查看完整版本: 新加了一个域名出现499,无法访问