Using goliath with blocking-io drivers

41 views
Skip to first unread message

Peter Kieltyka

unread,
Dec 28, 2011, 2:53:45 PM12/28/11
to Goliath.io
Hey guys,

I was just wondering.. would it be generally equivalent of using a
goliath app server with a blocking io driver as it would be with a
single sinatra+rack app?

I'm writing an API server that uses Mongoid, and I'd rather not go
down the rabbit hole of trying to make em-mongo play nice with
Mongoid. For now the synchronous driver will be just fine, but I'm
curious of any implications of using a blocking driver in Goliath.

I did some tests with ab, and while running in production for a single
process I was getting 114 req/sec.. that is not bad.

Cheers,

Peter

dan sinclair

unread,
Dec 28, 2011, 3:41:23 PM12/28/11
to golia...@googlegroups.com
As long as you're willing to accept only handling 1 request at a time, I can't think of any reason why Goliath would have an issue with that setup.

dan

Andrew Cholakian

unread,
Dec 28, 2011, 4:31:40 PM12/28/11
to golia...@googlegroups.com
As dan said, should be fine.

However, at that point why not use Sinatra?

On Wed, Dec 28, 2011 at 11:53 AM, Peter Kieltyka <peter.k...@nulayer.com> wrote:

Ilya Grigorik

unread,
Dec 28, 2011, 10:56:53 PM12/28/11
to golia...@googlegroups.com
On Wed, Dec 28, 2011 at 4:31 PM, Andrew Cholakian <and...@andrewvc.com> wrote:
However, at that point why not use Sinatra?

Because you can then swap in the em-mongo backed mongoid driver (in the works), and.. :-)

ig 

Peter Kieltyka

unread,
Dec 28, 2011, 11:03:11 PM12/28/11
to golia...@googlegroups.com
Exactly :)

And plus.. I just prefer Goliath.. I have my own set of conventions I've built in and it feels at home.

dan sinclair

unread,
Dec 28, 2011, 11:18:12 PM12/28/11
to golia...@googlegroups.com
Out of curiosity, are those conventions online anywhere? Would be interesting to see how you've adapted it to your style.

dan

Peter Kieltyka

unread,
Dec 28, 2011, 11:53:22 PM12/28/11
to golia...@googlegroups.com
Sure.. here's something very simple


It could be refactored to be even cleaner, but this got me going with the structure I had wanted. Would love to hear what you think..

Cheers.

dan sinclair

unread,
Dec 29, 2011, 12:06:03 AM12/29/11
to golia...@googlegroups.com
That's awesome. Looks like a pretty good base setup for writing APIs.

dan

Peter Kieltyka

unread,
Dec 29, 2011, 12:10:36 AM12/29/11
to golia...@googlegroups.com
Thanks.. here's another example I just put together for something I was working on when prototyping some ad-serving proxy code / JS injection... etc. ... I figured out another approach for my main problem, but this turned out to be a nifty piece of code.
Reply all
Reply to author
Forward
0 new messages