Websocket AutoBahn in master slow performance compared to 3 branch

183 views
Skip to first unread message

Vibul Imtarnasan

unread,
Apr 25, 2012, 9:51:54 PM4/25/12
to ne...@googlegroups.com
Hi,

Today, I've just sent a pull request for checking web sockets max frame payload length  (See Issue #283).

The same changes were applied to both the 3 and master branch.  In running the AutoBahn test suite (see instructions in io.netty.example.http.websocketx.autobahn.package-info), I've found that an AutoBahn tests sending 1000 messages to the 3 branch runs < 1 sec while the same test run against master takes 40 seconds.

Naturally, I' removed my changes and the results were the same: 3 branch runs < 1 sec while the same test run against master takes 40 seconds.  So I am sure it is not the new code that I added.

I also did a test where I sent 1000 messages from the netty example web socket client to the example web socket server. The results were < 1 sec for both master and 3 branch.  From this I think we can conclude that it is something to do with the interaction between AutoBahn (Python/Twisted) and Netty.

Rolling back the master code commits, I found that the slow down started happening on commit "Use gathering writes if java version is >= 7 . See #269 and #271" https://github.com/netty/netty/commit/6e2e9fb3c5e2d79c37cc618549aa4b7fe51499b4

If I comment out the following lines in transport/src/main/java/io/netty/channel/socket/nio/SendBufferPool.java, the performance issue goes away.
        //if (src instanceof CompositeChannelBuffer && DetectionUtil.javaVersion() >= 7) {
        //    return new GatheringSendBuffer(src.toByteBuffers());
        //}

I am using Java 7 open jdk 64 bit so that I can compile Netty.  I'm on Ubuntu11.10.


Any thoughts as to why GatheringSendBuffer could cause a slow down in performance?

Thanks
Vibul.






Norman Maurer

unread,
Apr 26, 2012, 12:54:17 AM4/26/12
to ne...@googlegroups.com
What puzzles me is that the gathering code exists in both branches. Let me try to run the tests here too and see if I can reproduce the slow down.

-- 
Norman Maurer
Sent with Sparrow

Vibul Imtarnasan

unread,
Apr 26, 2012, 8:28:49 PM4/26/12
to ne...@googlegroups.com
Thanks Noman,

Rather than running the entire testsuite you can just specify the exact test case in fuzzing_client_spec.json.

{

   "options": {"failByDrop": false},

   "enable-ssl": false,

   "servers": [{"agent": "Netty", "url": "ws://localhost:9000", "options": {"version": 17}}],

   "cases": ["9.7.2"],

   "exclude-cases": [],

   "exclude-agent-cases": {"FoobarServer*": ["4.*", "1.1.3"]}

Vibul Imtarnasan

unread,
Jul 18, 2012, 10:54:56 PM7/18/12
to ne...@googlegroups.com
Hi all,

I've just ran the AutoBahn tests against netty master today and am happy to report that this problem has now gone away :-)

All AutoBahn tests passed as well.

Thanks
Vibul
Reply all
Reply to author
Forward
0 new messages