新手问题 Faye 的服务可否启动在非 Thin 上,并且如何配置?

qiao2818 · October 21, 2015 · Last by qiao2818 replied at October 23, 2015 · 2469 hits

简单描述: 1.gem 'faye-rails'

2.RAILS_ENV=production bundle exec rackup private_pub.ru -s thin -d -E production 使用 thin 启动 faye,并监听 9292 端口。

3.proxy_pass http://127.0.0.1:9292; 生产环境下,使用 nginx 与 unicorn,这里使用一个代理,将请求转发给 9292 端口的服务。

请问: 1.这种方式启动 faye,负载量和性能怎么样?(如果服务器的配置是 2 核 2G 或者 4 核 4G 或者其他,最好有参考的数据)

2.如果不使用 thin,如何使用 nginx 或其他启动 faye?(希望高手贴下配置,谢谢)

I think there is nothing to do with Nginx. It's pretty sure you can use passenger, unicorn(rainbow), puma, instead of thin, in your project with faye-rails gem.

For example, in my project I use Puma:

config.middleware.use FayeRails::Middleware, mount: '/faye',engine: {type: Faye::Redis, uri: "#{ENV['REDIS_URL']}/4"}, :timeout => 25, server: 'puma' do
      # ...
end

You can find more detail on StackOverflow or Google, good luck.

@pengedy Ok, I will search it, thank you.

Faye 跑在 nodejs 下也非常稳定。

@jimrokliu 哦哦,谢谢,负载量和性能怎么样?

#4 楼 @qiao2818 nodejs 只能利用一颗 cpu,你要启动多个进程才行。性能比 ruby 的强。

You need to Sign in before reply, if you don't have an account, please Sign up first.