部署 Ruby China 是采用了什么架构和技术让网站这么快的?

lemayi · 2013年11月04日 · 最后由 debbbbie 回复于 2013年11月21日 · 10103 次阅读

我发现 Ruby China 首页打开后,然后打开其他页面速度特别的快。 请问主要是采用了哪些技术呢?

#好问题

哪啊,核心部分用汇编写的,当然快了

你们你们 ...

一群熊孩子。。。。。看这里看这里 http://ruby-china.org/test.asp

竟然是用 asp 做的????

其实全是 html 静态页 都是鹳狸猿一个一个新建的 http://ruby-china.org/test.html

竟然用了.NET,http://ruby-china.org/test.aspx 。。。你们又骗我。。

其实他们都是骗你的 , 据我所知 RubyChina 利用了世界最先进的 脑电波传输技术 .


你现在看到的文字就是我通过脑电波发送给你的 ...

哈哈哈哈……

#12 楼 @song940 难不成我老婆看我在对着个空白屏幕看半天???人类真恐怖。湖人竟然被扳平了。。。最后 25 秒啦。。。。

。。。。。。。。。。。。。。 看来我问的这个问题表达的很戳了。 其实我是想说,用了些说明缓存技术,有没有用 cdn,用了 rails4 的哪些特性之类的。

#2 楼 是他 @jjym 把楼带歪了,他回复你,我在捏着鼻子喝中药呢。。。。

#16 楼 @liwei78 顺便问下,Ruby China 中的消息提醒使用的什么技术。就是在我不刷新页面的情况下,如果有人回复,自动会显示消息条数。请问这是用到了 rails 的什么特性么?

java nodejs php ,这三门语言相互结合,最后就提高了效率。

#19 楼 @huacnlee 谢谢,很受用。 #21 楼 @ruby_sky 午休结束了,不扯了,下午看看代码的具体实现,学习下。

@lemayi 根据楼主的描述应该是这个, turbolinks

小歪个,不要生气。 速度瓶颈总在 IO,所以存储直接用 VSAM 格式保存到文件,放在 Mainframe 的 zos 系统中,使用 COBOL 或 PL/1 访问数据,通过 websphere 连接 java,java 层面封装业务逻辑后全部以 thrift 接口格式开放出来,前台用 php 来调数据写页面,也可以 php 封装后开放 json 接口,前台上 js 框架来做页面和调用数据。

正经的说, 先上了功能,然后根据测试和应用情况,发现效率低的地方,再改进。不一定一开始就想好方案来保证万无一失的性能。

26 楼 已删除

#26 楼 @putty 这回复太低俗了,这里是技术社区。

#26 楼 @putty #27 楼 @ReiDislike 功能么 .

#28 楼 @song940 我忘了我可以删回复。

@Rei 像受到了刺激的盆友道歉

好问题。

快是因为,所有页面都是无刷新的,都是 js 来做的。rails4 的幺蛾子就是封装了前后端的差异,我猜~~

我觉得主要是机房线路快 + 缓存。

#31 楼 @Tony612 于是如果注册用户叫做topics会如何……

#37 楼 @huacnlee 所以如果叫wiki呢……还是说注册的时候就已经检验了?

#38 楼 @cassiuschen 都是一样的,这是一起的东西,Rails Route 里面已经设置了优先解析系统的路由

#39 楼 @huacnlee 哦…………原来如此………………

匿名 #43 2013年11月05日

这样的问题直接 @huacnlee 吧,笑得我...

44 楼 已删除
45 楼 已删除
46 楼 已删除

#45 楼 @dplord 请不要测试,用预览

48 楼 已删除

我也歪个楼.... 就一论坛,又没有啥动态的信息聚合地理位置等等,速度要是不快,也太对不起 ruby 论坛的面子了。

而且这个技术是用的人越多,越快啊

语言不是重点,设计很重要. ruby 让你关注设计,减少语言层面的折腾,很人性化。

速度快的原因不是缓存和网速吗... 什么都来了

实际跑了下 Benchmark 对比发现其实不是算快……网速很快倒是真的:

angularjs.cn

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/

ruby-china

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)

google

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)

#56 楼 也就是又拍云比阿里云快的样子?

#52 楼 @xibeta 擦,test 要火啊

huacnlee 请问一下 ruby-china 的网站架构是怎样的? 提及了此话题。 10月31日 10:17
需要 登录 后方可回复, 如果你还没有账号请 注册新账号