|
|
|
Dug a little further into the issue.
I can recreate the performance hit using both nil and "" by varying the value sent to @io.sysread in net/protocol.rb def rbuf_fill is "": 10.302000 0.000000 10.302000 ( 10.302537) [java] The bug is dependent on the length allocated by the ByteBuffer for the response. If the resposne is bigger than the allocation (currently 1024 * 16) then it's going to take 10+ seconds to recover. Looked at the problem a little more.
SSLSocket.sysread calls waitSelect with rsel and tries to select on rsel with a blocking select. If i change waitSelect from: sel.select(); to sel.selectNow(); Speed increases, but this clearly isn't a solution because the while loop in protocol.rb#read is far more CPU intensive because it's no longer blocking. Hey, this one slipped off my radar. Is it still an issue? Clock's ticking on 1.1.3.
Problem still exists using:
jruby 1.1.3-dev (ruby 1.8.6 patchlevel 114) (2008-07-16 rev 7192) [i386-java] jruby-openssl-0.2.3 Ok, looks like this is squarely a JRuby-OpenSSL issue, and won't hold up the 1.1.3 release. But we obviously need to fix it. I'm bringing up JOSSL now to see if it's something simple.
I couldn't find anything obvious, but one suggestion I'd have for whoever works on this (including me) is that we should probably start looking at removing the SSL implementations of various IO/socket methods and falling back on IO's versions, since they're more in line with Ruby behavior. Punting to post 1.1.3, since it probably won't be a change in JRuby to fix it.
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||
I'm using jruby-openssl-0.2.3.
After following the data to sysread as the bottleneck I did and search and found the History.txt file had a line that is probably relevant to the problem.
== 0.2
JRUBY-1888)