其他 貌似 BAE 跑 Rails 速度还可以

cxh116 · 2014年04月29日 · 最后由 cxh116 回复于 2014年04月30日 · 3922 次阅读

http://hellorails.duapp.com/posts

nginx+puma(1 worker), 256RAM

简单的连接 Mysql 查询,X-Runtime:0.010077

ab 简单测试结果

ab -n 1000 -c 100 http://hellorails.duapp.com/posts

Server Software:        nginx/1.5.13
Server Hostname:        hellorails.duapp.com
Server Port:            80

Document Path:          /posts
Document Length:        1242 bytes

Concurrency Level:      100
Time taken for tests:   15.148 seconds
Complete requests:      1000
Failed requests:        0
Total transferred:      2099000 bytes
HTML transferred:       1242000 bytes
Requests per second:    66.01 [#/sec] (mean)
Time per request:       1514.832 [ms] (mean)
Time per request:       15.148 [ms] (mean, across all concurrent requests)
Transfer rate:          135.32 [Kbytes/sec] received

Connection Times (ms)
              min  mean[+/-sd] median   max
Connect:       28   30   1.5     30      34
Processing:    66 1115 618.9   1073    7491
Waiting:       66 1109 601.5   1072    7466
Total:         94 1145 618.8   1102    7519

Percentage of the requests served within a certain time (ms)
  50%   1102
  66%   1176
  75%   1213
  80%   1246
  90%   1507
  95%   1586
  98%   2568
  99%   4272
 100%   7519 (longest request)

# production.log
I, [2014-04-29T09:22:17.227352 #1908]  INFO -- : Started GET "/posts" for 222.240.208.131 at 2014-04-29 09:22:17 +0800
I, [2014-04-29T09:22:17.229053 #1908]  INFO -- : Processing by PostsController#index as HTML
I, [2014-04-29T09:22:17.233108 #1908]  INFO -- :   Rendered posts/index.html.erb within layouts/application (2.9ms)
I, [2014-04-29T09:22:17.233823 #1908]  INFO -- : Completed 200 OK in 5ms (Views: 2.8ms | ActiveRecord: 1.1ms)
I, [2014-04-29T09:22:19.549007 #1908]  INFO -- : Started GET "/posts" for 222.240.208.131 at 2014-04-29 09:22:19 +0800
I, [2014-04-29T09:22:19.552775 #1908]  INFO -- : Processing by PostsController#index as HTML
I, [2014-04-29T09:22:19.557303 #1908]  INFO -- :   Rendered posts/index.html.erb within layouts/application (3.4ms)
I, [2014-04-29T09:22:19.558028 #1908]  INFO -- : Completed 200 OK in 5ms (Views: 2.9ms | ActiveRecord: 1.5ms)

@mobiwolf 自定义 Ruby 运行时目前就差 Supervisor 启动问题了,在 cloudqa 发帖等待回复中

-============================================-

项目源码已经放出,请看 http://ruby-china.org/topics/19008

"We're sorry, but something went wrong."

#1 楼 @ruby_sky If you are the application owner check the logs for more information

#1 楼 @ruby_sky 目前的 Ruby 是测试环境,不稳定。不建议用于生成环境!

楼主目前也是试玩阶段

楼主,问题已经转到 RD 那边了。

#2 楼 @dddd1919 @ruby_sky 刚看了下,http://hellorails.duapp.com/posts 现在似乎访问正常了。不过相当不稳定,忽好忽坏的

#1 楼 @ruby_sky #2 楼 @dddd1919 mysql 数据连接超时了,记得 bae 文档有说超过多少分钟连接会自动断开,现在尝试加上 mysql2 的 reconnect 参数看看还有没有这问题

#6 楼 @mobiwolf 刚才在部署,现在应该好了

#8 楼 @cxh116 修改的差不多的 Runtime,配置文件部署是不是可以考虑开源到 Github 上,这样爱好者们,大家可以一起分享来玩。那个 zip 文件,可以放在百度个人网盘上,让 BAE3.0 直接拉取那个地址加载。让跟多人一起参与把玩,才能一起通过社区的力量把这个玩好。哈哈

#9 楼 @mobiwolf 主要是 Supervisor 启动问题还没有解决,等解决后就放出来的,然后写篇简单文章,把一些注意事项,定制运行时步骤给记录下来

#7 楼 @cxh116 需要用户持续访问来保证数据库不断开啊

你这个配置,BAE 每月收多少钱?

#12 楼 @tylerlong 256m 的,0.4 元/天 512m 的,0.7 元/天 128m 的,0.2 元/天

感觉把服务端换成 thin,用 128m 跑小应用应该也没问题 puma 有个主进程,多个工作进程,设置工作进程为 1 时,还是有两个 ruby 进程,主进程差不多 70M 的内存,工作进程 120m 的内存 nginx 两个进程加起来不到 3m

@cxh116 价钱不错。可惜是 paas,不是 iaas

#14 楼 @steve IaaS 可以考虑阿里云,青云这类。

敢问楼主,bae ruby 需要邀请码么?

#16 楼 @davidqhr 自定义运行时现在还需要申请

#17 楼 @cxh116 能给说说具体步骤么,我也想去试试

#18 楼 @davidqhr 申请看这里和找@mobiwolf http://ruby-china.org/topics/18541

另外我定制的这个 ruby 运行时还有问题,不能自动运行,所以现在还没有公开操作步骤

需要 登录 后方可回复, 如果你还没有账号请 注册新账号