问题描述:服务器请求微信后台(api.weixin.qq.com)的测试结果,每次请求都需要4,5秒甚至更慢。
2016.12.16 16:31:57 start:1481877117.4148
request:https://api.weixin.qq.com/cgi-bin/message/custom/send?access_token=_sM9t69uM9Xr0-zD05Kk0EgsOQYGcymQdWbzjPg3gXAUyqtrepdXwHZJtIXPlSwUMmshinSK-gi94A1I5_4gkb5Me6NODMX95ecq-sH2rJzc9ooQsBrLsMkMZqIfDgj8BOGeAAAGTL
2016.12.16 16:32:00 end:1481877120.34562016.12.16 16:32:31 start:1481877151.3133
request:https://api.weixin.qq.com/cgi-bin/message/custom/send?access_token=_sM9t69uM9Xr0-zD05Kk0EgsOQYGcymQdWbzjPg3gXAUyqtrepdXwHZJtIXPlSwUMmshinSK-gi94A1I5_4gkb5Me6NODMX95ecq-sH2rJzc9ooQsBrLsMkMZqIfDgj8BOGeAAAGTL
2016.12.16 16:32:40 end:1481877160.38612016.12.16 16:32:56 start:1481877176.1248
request:https://api.weixin.qq.com/cgi-bin/message/custom/send?access_token=_sM9t69uM9Xr0-zD05Kk0EgsOQYGcymQdWbzjPg3gXAUyqtrepdXwHZJtIXPlSwUMmshinSK-gi94A1I5_4gkb5Me6NODMX95ecq-sH2rJzc9ooQsBrLsMkMZqIfDgj8BOGeAAAGTL
2016.12.16 16:33:00 end:1481877180.38652016.12.16 16:33:15 start:1481877195.3732
request:https://api.weixin.qq.com/cgi-bin/message/custom/send?access_token=_sM9t69uM9Xr0-zD05Kk0EgsOQYGcymQdWbzjPg3gXAUyqtrepdXwHZJtIXPlSwUMmshinSK-gi94A1I5_4gkb5Me6NODMX95ecq-sH2rJzc9ooQsBrLsMkMZqIfDgj8BOGeAAAGTL
2016.12.16 16:33:20 end:1481877200.3728
一直跟产品说,这个没法解决,纠结了很久,后来请教了网络工程师,可以通过设置dns解析来优化。
在服务器的dns server列表里面加了两个移动的dnsserver
目前dns解析 api.weixin.qq.com的地址是183.232.103.145,
如果速度还是慢的话,可以在/etc/hosts文件里面把两者对应起来。
就这样,纠结了好久的问题轻松解决了
2016.12.19 10:44:35 start:1482115475.0122
2016.12.19 10:44:35 end1482115475.5604