我发现 Ruby China 首页打开后,然后打开其他页面速度特别的快。 请问主要是采用了哪些技术呢?
。。。。。。。。。。。。。。 看来我问的这个问题表达的很戳了。 其实我是想说,用了些说明缓存技术,有没有用 cdn,用了 rails4 的哪些特性之类的。
其实没太多复杂的东西
小歪个,不要生气。 速度瓶颈总在 IO,所以存储直接用 VSAM 格式保存到文件,放在 Mainframe 的 zos 系统中,使用 COBOL 或 PL/1 访问数据,通过 websphere 连接 java,java 层面封装业务逻辑后全部以 thrift 接口格式开放出来,前台用 php 来调数据写页面,也可以 php 封装后开放 json 接口,前台上 js 框架来做页面和调用数据。
正经的说, 先上了功能,然后根据测试和应用情况,发现效率低的地方,再改进。不一定一开始就想好方案来保证万无一失的性能。
实际跑了下 Benchmark 对比发现其实不是算快……网速很快倒是真的:
Benchmarking www.angularjs.cn (be patient).....done
Server Software: Tengine/1.5.1
Server Hostname: www.angularjs.cn
Server Port: 80
Document Path: /
Document Length: 4725 bytes
Concurrency Level: 5
Time taken for tests: 0.495 seconds
Complete requests: 20
Failed requests: 0
Write errors: 0
Total transferred: 99960 bytes
HTML transferred: 94500 bytes
Requests per second: 40.43 [#/sec] (mean)
Time per request: 123.672 [ms] (mean)
Time per request: 24.734 [ms] (mean, across all concurrent requests)
Transfer rate: 197.33 [Kbytes/sec] received
Connection Times (ms)
min mean[+/-sd] median max
Connect: 51 54 2.0 54 59
Processing: 54 64 15.6 59 101
Waiting: 53 61 13.2 57 99
Total: 108 118 15.6 112 155
Percentage of the requests served within a certain time (ms)
50% 112
66% 114
75% 116
80% 117
90% 154
95% 155
98% 155
99% 155
100% 155 (longest request)
Benchmarking www.angularjs.cn (be patient).....done
Server Software: Tengine/1.5.1
Server Hostname: www.angularjs.cn
Server Port: 80
Document Path: /api/article/AOmJ
Document Length: 129 bytes
Concurrency Level: 5
Time taken for tests: 0.450 seconds
Complete requests: 20
Failed requests: 0
Write errors: 0
Total transferred: 8460 bytes
HTML transferred: 2580 bytes
Requests per second: 44.40 [#/sec] (mean)
Time per request: 112.617 [ms] (mean)
Time per request: 22.523 [ms] (mean, across all concurrent requests)
Transfer rate: 18.34 [Kbytes/sec] received
Connection Times (ms)
min mean[+/-sd] median max
Connect: 50 54 2.5 54 59
Processing: 55 57 2.0 57 62
Waiting: 55 57 1.9 56 62
Total: 105 112 3.6 111 120
Percentage of the requests served within a certain time (ms)
50% 111
66% 112
75% 114
80% 115
90% 117
95% 120
98% 120
99% 120
100% 120 (longest request)
This is ApacheBench, Version 2.3 <$Revision: 1430300 $>
Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/
Licensed to The Apache Software Foundation, http://www.apache.org/
Benchmarking ruby-china.org (be patient).....done
Server Software: nginx/1.4.2
Server Hostname: ruby-china.org
Server Port: 80
Document Path: /
Document Length: 33423 bytes
Concurrency Level: 5
Time taken for tests: 1.197 seconds
Complete requests: 20
Failed requests: 9
(Connect: 0, Receive: 0, Length: 9, Exceptions: 0)
Write errors: 0
Total transferred: 686786 bytes
HTML transferred: 668486 bytes
Requests per second: 16.71 [#/sec] (mean)
Time per request: 299.260 [ms] (mean)
Time per request: 59.852 [ms] (mean, across all concurrent requests)
Transfer rate: 560.29 [Kbytes/sec] received
Connection Times (ms)
min mean[+/-sd] median max
Connect: 26 36 11.0 30 65
Processing: 145 238 86.7 221 471
Waiting: 107 162 66.4 142 340
Total: 177 274 83.9 250 499
Percentage of the requests served within a certain time (ms)
50% 250
66% 288
75% 317
80% 325
90% 465
95% 499
98% 499
99% 499
100% 499 (longest request)
Benchmarking www.google.com (be patient).....done
Server Software: gws
Server Hostname: www.google.com
Server Port: 80
Document Path: /
Document Length: 376 bytes
Concurrency Level: 5
Time taken for tests: 0.563 seconds
Complete requests: 20
Failed requests: 0
Write errors: 0
Non-2xx responses: 20
Total transferred: 18480 bytes
HTML transferred: 7520 bytes
Requests per second: 35.55 [#/sec] (mean)
Time per request: 140.635 [ms] (mean)
Time per request: 28.127 [ms] (mean, across all concurrent requests)
Transfer rate: 32.08 [Kbytes/sec] received
Connection Times (ms)
min mean[+/-sd] median max
Connect: 41 43 1.8 43 46
Processing: 87 91 6.4 90 117
Waiting: 87 91 6.3 90 116
Total: 128 134 7.1 133 160
Percentage of the requests served within a certain time (ms)
50% 133
66% 135
75% 136
80% 137
90% 141
95% 160
98% 160
99% 160
100% 160 (longest request)