Error while starting Puma server with workers

孤者浪人 提交于 2019-12-03 11:58:59

To cite from the Puma README:

Because of various platforms not being implement certain things, the following differences occur when Puma is used on different platforms:

  • JRuby, Windows: server sockets are not seamless on restart, they must be closed and reopened. These platforms have no way to pass descriptors into a new process that is exposed to ruby
  • JRuby, Windows: cluster mode is not supported due to a lack of fork(2)
  • Windows: daemon mode is not supported due to a lack of fork(2)

As it clearly states, cluster mode (i.e. running a single puma instance with multiple workers) and daemon mode (detaching from the shell after starting) are not supported on Windows.

You should either use a differt OS (e.g. Linux) or use Puma in single-worker mode. You could manually start multiple Puma instance on different ports and loadbalance between them though, even on Windows. You just need a frontend loadbalancer for that and it isn't as seamless as the native cluster mode builtin to Puma.

yup i had this same issue and found the solution at https://devcenter.heroku.com/articles/deploying-rails-applications-with-the-puma-web-server under the topic 'Workers'. If you're on windows orJRuby omit the line "workers Integer(ENV['WEB_CONCURRENCY'] || 2) " in your config/puma.rb file. it solved it for me. Read the link above for more info.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!