Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Am I to understand that Einhorn doesn't require the use of Unix sockets to delegate work to workers? If so, it could work quite nicely for JRuby apps as Java doesn't support Unix sockets and it's therefore not possible to just plop nginx in front of the Web server (Tomcat or Jetty) instances and have it queue up requests to a shared Unix socket like the typical Unicorn setup does.


That's correct. In fact, at the moment Einhorn only supports TCP sockets. (That being said, I might be mistaken, but I think that Unicorn can also bind TCP sockets.)


Thank you for the follow-up. Even though Unicorn does support TCP sockets, it is irrelevant for our JRuby apps as I believe (IIRC) it won't even install under JRuby due to being written in C only, with no native-Java or pure-Ruby alternatives available. So it's not a Web server that can be used for serving JRuby apps.

Now, since you've extracted the capabilities of Unicorn out into something that isn't coupled to a Web server (and it's written in pure Ruby, so is portable), we should be able to use it as a shim between nginx for managing Trinidad (Tomcat) instances. Very much looking forward to giving it a try - thanks for your efforts!

EDIT: Whoops, guess I spoke a bit too soon. I get this error:

  NotImplementedError: fork is not available on this platform
I think a typical workaround on JRuby is to use the posix-spawn or spoon gems. If I have some time this next weekend maybe I could test this a bit more and maybe formulate a patch. Example posix-spawn usage [here][1].

[1]: https://github.com/ddollar/foreman/blob/master/lib/foreman/p...


Ah, interesting. Yeah, would love a patch!




Consider applying for YC's Fall 2026 batch! Applications are open till July 27.

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: