Roger Pack
2008-Jan-15 08:28 UTC
[Eventmachine-talk] Eventmachine-talk Digest, Vol 21, Issue 22
> These tests are all single-threaded to begin with. I can construct a stress > test that uses non-network events, for example, a large number of EM''s > Erlang-like spawned processes. These tests run far faster on 1.9 than on 1.8. > As soon as large numbers of network events come into the picture, the > improvement is much less noticeable. Since EM doesn''t rely on Ruby to do any > of its network handling, I think the difference is just because the > performance profile becomes dominated by the kernel. But that''s just a > hypothesis.Might be worth gprof''iling or ruby-prof''ing to see where that bottleneck is :) (might even be in EM C code, though I doubt it).> Are you sure? I''ve used select loops in Microsoft for years and I don''t > remember a 64-descriptor limit. Unless you''re using a desktop version of > Windows, like XP or Vista.I am sure that c''s connect will return you up to the number of file descriptors available to the process (256 for mingw on windows xp pro). So for sure it allows you more file descriptors than FD_SETSIZE is set to, (64). That one''s easy. The part that, as you pointed out, is almost unbelievable, is the ''apparent'' 64 socket limit to select. I didn''t think this was the case and wouldn''t have believed it myself, except that the ''descriptor tester'' test fails if I have re-set FD_SETSIZE > 64 in the Makefile. It might be mingw''s fault. It might be the reliance on ruby-msvcrt18.dll. I''m not sure. It is indeed truly odd. It might be because when ruby itself was compiled, FD_SETSIZE was set to 64. Googling for "windows 64 socket select" reveals that select itself seems to be limited to 64 "per thread" -- their answer? Use multiple threads or I/O completion ports. Threads? yuck. http://tangentsoft.net/wskfaq/advanced.html http://mail.zope.org/pipermail/zope3-dev/2002-October/003235.html I/O completion ports seem to be the only answer--which might not jive with Ruby''s own select, but, hey :) Thanks all. -- Wherefore if ye shall press forward, feasting upon the word of Christ, and endure to the end, behold thus saith the Father: ye shall have eternal life. - 2 Nephi 31:20