Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Web server: Thin, Puma, Unicorn, Rainbows!, Passenger(Raptor) #1

Open
JiangYongKang opened this issue Oct 19, 2017 · 0 comments
Open

Comments

@JiangYongKang
Copy link
Owner

JiangYongKang commented Oct 19, 2017

What are the main features provided by these web servers, respectively?

Thin

  • 单线程多进程
  • 比较老的一个服务器,停止开发了
  • 然鹅,我感觉它还是挺高效的

Unicorn

  • 单线程多进程的实现
  • 一个进程处理一个请求

Puma

  • Rails 5 的默认服务器
  • 多线程多进程(Puma 2.0 以前是单线程)
  • 一个线程处理一个请求

Rainbows

  • 多进程多线程,基于 Unicorn 开发。
  • Rainbows 和 Unicorn 是同一作者实现的
  • 基本用法、配置 和 Unicorn 几乎一样

Comparing Puma v.s. Unicorn, what are the pros and cons?

Puma 和 Unicorn 之间的性能差异并不是很大。感觉两个之间应用场景不同。
大型应用使用 Unicorn 更好一些,希望节省服务器资源的小型应用更适合用 Puma。
Unicorn 提供了很多通过信号控制进程的手段,方便系统管理员干预应用服务器运行。
在单进程模式下 Puma 只有1个工作进程,单 Unicorn 仍然会启动 master-worker 模式,因此Puma的单进程更节省内存。
Puma的线程可以根据请求自动伸缩,对于请求量小的应用,比较节省资源。
PS: Puma、Unicorn 的进程数量不要开太多,最好和 CPU 的核数相等即可。

我的部署代码案例

参考文档

@JiangYongKang JiangYongKang changed the title What are the main features provided by these web servers, respectively? Web server: Thin, Puma, Unicorn, Rainbows!, Passenger(Raptor) Oct 19, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant