ohler55 / agoo

A High Performance HTTP Server for Ruby
MIT License
908 stars 39 forks source link

Integration with Rails #85

Closed nichthinkof30 closed 4 years ago

nichthinkof30 commented 4 years ago

Found out agoo from awesome_ruby page, impressed with the benchmark. I would like to know is 'agoo' can be a replacement of 'puma' and run on rails out of the box?

ohler55 commented 4 years ago

It certainly can. There are some example of running Rack applications. Simple examples but the principle is the same. Check out this page for some help. https://github.com/ohler55/agoo/blob/develop/misc/rails.md

nichthinkof30 commented 4 years ago

Thanks @ohler55 i saw agoo seems like emphasizing more on the speed for serving static assets, how about performance in term of API and the connectivity with concurrency. We are building a chat app and rails is our backend to store all the msg, so I'm thinking whether does this help in a way. (We are using Pubnub as our real time infra tho, not websocket)

ohler55 commented 4 years ago

Agoo was originally build for supporting Rack as well as static assets. The benchmark numbers you see on the page reflect that. Rails is faster with Agoo but Rails still does all the processing outside of the web server part so there is only so much that can be done to make it faster. You might try Oj as well as it helps with the JSON use in Rails. As for using a pub-sub library there is no reason it can't be used with Agoo.