首页IT科技goliath grouper(Goliath)

goliath grouper(Goliath)

时间2025-05-27 01:19:19分类IT科技浏览6416
导读:Goliath...

Goliath

by postrank-labs

Installation & Prerequisites

Install Ruby 1.9 (via RVM or natively):

gem install rvm rvm install 1.9.2 rvm use 1.9.2

Install Goliath:

gem install goliath

Getting Started

require goliath class Hello < Goliath::API # default to JSON output, allow Yaml as secondary use Goliath::Rack::Render, [json, yaml] def response(env) [200, {}, "Hello World"] end end # > ruby hello.rb -sv # > [97570:INFO] 2011-02-15 00:33:51 :: Starting server on 0.0.0.0:9000 in development mode. Watch out for stones.

view raw

hello.rb

This Gist brought to you by GitHub.

Performance: MRI, JRuby, Rubinius

Goliath is not tied to a single Ruby runtime - it is able to run on MRI Ruby, JRuby and Rubinius today. Depending on which platform you are working with, you will see different performance characteristics. At the moment, we recommend MRI Ruby 1.9.2 as the best performing VM: a roundtrip through the full Goliath stack on MRI 1.9.2p136 takes ~0.33ms (~3000 req/s).

JRuby performance (with 1.9 mode enabled) is currently much worse than MRI Ruby 1.9.2, due to the fact that all JRuby fibers are mapped to native Java threads. However, there is very promising, existing work that promises to make JRuby fibers even faster than those of MRI Ruby. Once this functionality is built into JRuby (JRUBY-5461), JRuby may well take the performance crown. At the moment, without the MLVM support, a request through the full Goliath stack takes ~6ms (166 req/s).

Rubinius + Goliath performance is tough to pin down - there is a lot of room for optimization within the Rubinius VM. Currently, requests can take as little as 0.2ms and later spike to 50ms+. Stay tuned!

Goliath has been in production at PostRank for over a year, serving a sustained 500 requests/s for internal and external applications. Many of the Goliath processes have been running for months at a time (read: no memory leaks) and have served hundreds of gigabytes of data without restarts. To scale up and provide failover and redundancy, our individual Goliath servers at PostRank are usually deployed behind a reverse proxy (such as HAProxy).

Discussion and Support

API Examples Documentation Mailing List Issues

Contributing

You can clone the project with Git by running:

$ git clone git://github.com/postrank-labs/goliath
声明:本站所有文章,如无特殊说明或标注,均为本站原创发布。任何个人或组织,在未征得本站同意时,禁止复制、盗用、采集、发布本站内容到任何网站、书籍等各类媒体平台。如若本站内容侵犯了原著者的合法权益,可联系我们进行处理。

创心域SEO版权声明:以上内容作者已申请原创保护,未经允许不得转载,侵权必究!授权事宜、对本内容有异议或投诉,敬请联系网站管理员,我们将尽快回复您,谢谢合作!

展开全文READ MORE
硬盘分区分为几个(硬盘分区七大原则) seo的优化思路(seo的优化流程)