Is it possible to pass file/socket descriptor w/ EM? I can''t find anything mentioning this feature in the docs or googling or by browsing the code. W/ Ruby UNIXServer it looks trivial http://www.ruby-forum.com/topic/101840 Or if the number of open UNIX socket connections is limited, say 4, does it still make sense to use EM to connect to the UNIX socket or does plain UNIXServer / UNIXSocket does the same in term of perf and scalability since UNIX socket are non-blocking anyway. I hope this is clear enough, if not, let me know. thx, Marc
On Feb 4, 2008 3:38 PM, Marc-Andr? Cournoyer <macournoyer at gmail.com> wrote:> Is it possible to pass file/socket descriptor w/ EM? I can''t find > anything mentioning this feature in the docs or googling or by > browsing the code. > > W/ Ruby UNIXServer it looks trivial http://www.ruby-forum.com/topic/101840 > > Or if the number of open UNIX socket connections is limited, say 4, > does it still make sense to use EM to connect to the UNIX socket or > does plain UNIXServer / UNIXSocket does the same in term of perf and > scalability since UNIX socket are non-blocking anyway. >I hope this is clear enough, if not, let me know.>I''m going to guess that you''re looking for an extremely fast way of serving static files in Thin. If I were doing such a thing, I''d take a different approach. The key to performance when serving files is to minimize the pressure on the memory bus and the number of kernel crossings. Some platforms have a specialized function that copies pages mapped from files directly to kernel output buffers. Not sure if OSX is one of those. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/eventmachine-talk/attachments/20080204/07fa5655/attachment.html
Actually I was experimenting w/ forwarding requests to worker processes. But I''m still interested in a fast way to serve file. Is your FastFileReader in Swiftiply an implementation of what you just described or are you talking about sendfile system call? On 4-Feb-08, at 8:14 PM, Francis Cianfrocca wrote:> On Feb 4, 2008 3:38 PM, Marc-Andr? Cournoyer <macournoyer at gmail.com> > wrote: > Is it possible to pass file/socket descriptor w/ EM? I can''t find > anything mentioning this feature in the docs or googling or by > browsing the code. > > W/ Ruby UNIXServer it looks trivial http://www.ruby-forum.com/topic/101840 > > Or if the number of open UNIX socket connections is limited, say 4, > does it still make sense to use EM to connect to the UNIX socket or > does plain UNIXServer / UNIXSocket does the same in term of perf and > scalability since UNIX socket are non-blocking anyway. > I hope this is clear enough, if not, let me know. > > > > I''m going to guess that you''re looking for an extremely fast way of > serving static files in Thin. If I were doing such a thing, I''d take > a different approach. The key to performance when serving files is > to minimize the pressure on the memory bus and the number of kernel > crossings. Some platforms have a specialized function that copies > pages mapped from files directly to kernel output buffers. Not sure > if OSX is one of those. > > > _______________________________________________ > Eventmachine-talk mailing list > Eventmachine-talk at rubyforge.org > http://rubyforge.org/mailman/listinfo/eventmachine-talk-------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/eventmachine-talk/attachments/20080204/d8dba77a/attachment.html
On Feb 4, 2008 9:52 PM, Marc-Andr? Cournoyer <macournoyer at gmail.com> wrote:> Actually I was experimenting w/ forwarding requests to worker processes. > But I''m still interested in a fast way to serve file. Is > your FastFileReader in Swiftiply an implementation of what you just > described or are you talking about sendfile system call? > >FastFileReader goes part of the way in this direction, yes. I''m thinking about extending it with scatter I/O on platforms that support it (which includes BSD/OSX). There''s a lot of lore about the worker-process pattern out there. I''ve got a lot of experience with it myself, but I''ve never liked the sharing-descriptors approach because it''s not platform-neutral. I generally prefer the asynchronous-messaging or the (closely related) cross-process actor approach. This issue comes up so often that we need to put a proper multi-process framework on the EM wish list. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/eventmachine-talk/attachments/20080204/82d419ca/attachment.html