没有合适的资源?快使用搜索试试~ 我知道了~
资源详情
资源评论
资源推荐
手机端 API 网络性能测试报告
以下是 3 种网络环境——公司网线,wifi,联通 3g 网卡,针对线上 mobile-api 环境做的一
个网络性能测试报告。
平均响应时间
功能
API
联通
3G 网
卡
公
司
WIF
I
网
线
email 登
录
http://mobile-api.gaopeng-huoban.com/main.
action?
sign=4006e2a8143fe0b7e231c05a569a529c&
appId=GAOPENG_MOBILE_APP_1&phoneType
=android
&email=yuanjuxing@126.com&api=user.login
&format=xml&ver=1.0&password=juxing1982
135
ms
65
ms
6
5
m
s
deal 详
情
http://mobile-api.gaopeng-huoban.com/main.
action?sign=3fed848d4d663c81d0c1cbc0e3b8f
b30
&appId=GAOPENG_MOBILE_APP_1&phoneTyp
e=android&
api=citydeal.detail&format=xml&ver=1.0&dealI
d=1431736747
600
ms
80
ms
7
5
m
s
deal 列
表
http://mobile-api.gaopeng-huoban.com/main.
action?
sign=6f63384bc42ae34487ea92441fa71d2d&a
ppId=GAOPENG_MOBILE_APP_1
&lastCityName=%E5%8C%97%E4%BA%AC&ph
oneType=android
&cityName=%E5%8C%97%E4%BA%AC&api=cit
ydeal.lst&format=xml&ver=1.0&offset=0&size=
100
6.5s
3.7
s
3.
5s
即 将 过
期 的 优
惠券
http://mobile-api.gaopeng-huoban.com/main.
action?sign=9d4d4ec6fd7192d0123bc5e012b2
5e46&
cookie=77070e123e6c242d282e362c182c3226
3c3b28263967656c677d6e006a707
e7d7576676f7975737176706a61636d3c382c3
7162a77777d0073727b677578706e7d6d3f790
a041d
&appId=GAOPENG_MOBILE_APP_1&phoneTyp
e=android&api=couponCloseExpired.lst&forma
t=xml&ver=1.0
900
ms
119
ms
1
0
0
m
s
已 使 用
的 优 惠
券订单
http://mobile-api.gaopeng-huoban.com/main.
action?sign=ae0ab7a1959b7db022974055d8b5
cd42&
cookie=77070e123e6c242d282e362c182c3226
3c3b28263967656c677d6e006a707e7d
7576676f7975737176706a61636d3c382c3716
2a77777d0073727b677578706e7d6d3f790a04
1d
&appId=GAOPENG_MOBILE_APP_1&phoneTyp
e=android&api=couponUsed.lst&format=xml&
ver=1.0
1s
125
ms
9
5
m
s
未 使 用
的 优 惠
券订单
http://mobile-api.gaopeng-huoban.com/main.
action?sign=a439890c651ff223e0a47abf8140d
ec3&
cookie=77070e123e6c242d282e362c182c3226
3c3b28263967656c677d6e006a707e7d757
6676f7975737176706a61636d3c382c37162a7
7777d0073727b677578706e7d6d3f790a041d
&appId=GAOPENG_MOBILE_APP_1&phoneTyp
e=android&api=couponUnused.lst&format=xm
l&ver=1.0
2.1s
150
ms
1
3
0
m
s
百度
www.baidu.com
130
ms
45
ms
4
0
m
s
糯米
www.nuomi.com
500
ms
104
ms
1
0
0
m
s
高朋
www.gaopeng.com
1.27s
500
ms
5
0
0
m
s
从数据结果看,目前通过 3G 网卡访问手机 API 的响应时间是公司 wifi 和网线的 3 倍以上,
而且从百度、糯米、高朋网等情况来看,其响应时间也是在 3 倍以上。另外,在数据量较大
的情况下,响应时间较长,如获取 100 个 deal 列表,需要 6s 以上,但目前 deal 显示一般不
会超过 100 个,因此通过 3G 上网卡 API 在 3S 内都能返回处理结果。加上手机处理渲染的时
间。每次交互还是可以控制在 3-5S 内完成。3-5s 对用户体验影响不会很大。
结论:如果用户使用 3G 上网卡访问手机端,响应时间的用户体验在可接受范围内。
PS:我们网站的网络性能和糯米网有较大的差距。
补充 deal 列表取 10 条数据的情况:
http://mobile-api.gaopeng-huoban.com/main.action?sign=7d3e9b5a69680b82d99c8ec8a44638
3b&appId=GAOPENG_MOBILE_APP_1&lastCityName=100&phoneType=android&cityName= 北
京&api=citydeal.lst&format=xml&ver=1.0&offset=0&size=10
联通 3G 网卡
公司 WIFI
网线
1.9s
840ms
650ms
回复
考虑到手机 CPU 的运算能力比电脑要弱,同样是 3G 或者 Wifi ,其实手机的下载速度会
更慢
同样渲染显示的速度也慢
在这个时间上 乘以 1.5 是一个比较合适的估算
加速主要考虑 2 方面
(1) 用现有的 CDN 加速手机 API 输出内容 (设置 CDN 针对手机 API 域名的内容不做任
何缓存,只是一个简单的代理访问)
(2) 减小手机 API 输出的内容大小
<1> API 考虑把一些不需要的内容去除掉,不要输出
<2> nginx 配置打开 gzip 针对 text/json text/xml application/xml 的压缩, 同时把压缩
级别提高到 level 6 ( 缺省应该是 level 2)
剩余12页未读,继续阅读
扈涧盛
- 粉丝: 26
- 资源: 319
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功
评论0