[Bug 60523] Reduce number of network packets that server sends to client via WebSocket connection

2017-09-04 Thread bugzilla
https://bz.apache.org/bugzilla/show_bug.cgi?id=60523

Mark Thomas  changed:

   What|Removed |Added

 Status|REOPENED|RESOLVED
 Resolution|--- |FIXED

--- Comment #10 from Mark Thomas  ---
Fixed in:
- trunk for 9.0.0.M27 onwards
- 8.5.x for 8.5.21 onwards

Fixing this for 8.0.x and earlier would require significant refactoring -
effectively the refactoring that took place for 8.5.x.

-- 
You are receiving this mail because:
You are the assignee for the bug.
-
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org



[Bug 60523] Reduce number of network packets that server sends to client via WebSocket connection

2017-07-20 Thread bugzilla
https://bz.apache.org/bugzilla/show_bug.cgi?id=60523

Mark Thomas  changed:

   What|Removed |Added

 Status|RESOLVED|REOPENED
 Resolution|INVALID |---

--- Comment #9 from Mark Thomas  ---
Re-open to review the most recent comment.

-- 
You are receiving this mail because:
You are the assignee for the bug.
-
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org



[Bug 60523] Reduce number of network packets that server sends to client via WebSocket connection

2017-07-19 Thread bugzilla
https://bz.apache.org/bugzilla/show_bug.cgi?id=60523

--- Comment #8 from Joseph Dean  ---
I'm experiencing the same behavior. The client library I use to send data to my
server over websockets properly bundles the payload length and payload in a
single tcp datagram. Data coming from my tomcat server is always sending two
datagrams for a single message: one with 2 bytes of payload which is the
websocket header + payload length, and the 2nd which is the payload.

>From what I can see the doWrite(SendHandler, long, ByteBuffer...) sends each
provided buffer in a separate frame. We can see inside this method it invokes:

for (ByteBuffer buffer : buffers) {
  socketWrapper.write(true, buffer);
  // Snip
  socketWrapper.setWriteTimeout(timeout);
  socketWrapper.flush(true);
}

The original patch allocates a new buffer to place both the header and payload
in a single buffer before handing it to this method, which resolves the network
behavior but results in extra memory copies. Perhaps the more correct solution
is to modify WsRemoteEndpointImplServer::doWrite to only do a single socket
flush after writing all provided buffers?

The protocol I'm working on sends numerous very small packets; about 90% of my
traffic is TCP header overhead. Doubling the number of packets thus nearly
doubles my overall bandwidth usage. This is extremely important to my
application.

-- 
You are receiving this mail because:
You are the assignee for the bug.
-
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org



[Bug 60523] Reduce number of network packets that server sends to client via WebSocket connection

2017-01-12 Thread bugzilla
https://bz.apache.org/bugzilla/show_bug.cgi?id=60523

--- Comment #7 from Mark Thomas  ---
(In reply to Ilgar Kovalyov from comment #6)
> Hello, Mark.
> I just installed Autobahn WebSocket testsuite.
> Can you tell me more about your tests?
> I want to reproduce test results.
> What web application did you deployed at tomcat for test purposes?

The programmatic WebSocket echo example in the Tomcat examples 

> What test did you run?

All of the Autobhan WebSocket server tests.

There are some very old results that give you an idea of the tests being run
here:
http://home.apache.org/~markt/dev/autobahn/

I ran a more recent version of those tests (but not the latest).

-- 
You are receiving this mail because:
You are the assignee for the bug.
-
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org



[Bug 60523] Reduce number of network packets that server sends to client via WebSocket connection

2017-01-12 Thread bugzilla
https://bz.apache.org/bugzilla/show_bug.cgi?id=60523

--- Comment #6 from Ilgar Kovalyov  ---
Hello, Mark.
I just installed Autobahn WebSocket testsuite.
Can you tell me more about your tests?
I want to reproduce test results.
What web application did you deployed at tomcat for test purposes?
What test did you run?

-- 
You are receiving this mail because:
You are the assignee for the bug.
-
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org



[Bug 60523] Reduce number of network packets that server sends to client via WebSocket connection

2017-01-11 Thread bugzilla
https://bz.apache.org/bugzilla/show_bug.cgi?id=60523

Mark Thomas  changed:

   What|Removed |Added

 Resolution|--- |INVALID
 Status|NEW |RESOLVED

--- Comment #5 from Mark Thomas  ---
The proposed patch will not be applied because it results in significant
performance degradation rather than an improvement.

Testing with the Autobahn WebSocket testsuite showed performance decreased more
than 2 orders of magnitude when the proposed patch was applied.

Whether the additional copies, the additional allocations or other factors are
responsible for the performance degradation might be an interesting topic to
research.

Performance bottlenecks are notoriously difficult to identify via code
inspection in all but the most trivial of cases.

-- 
You are receiving this mail because:
You are the assignee for the bug.
-
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org



[Bug 60523] Reduce number of network packets that server sends to client via WebSocket connection

2017-01-11 Thread bugzilla
https://bz.apache.org/bugzilla/show_bug.cgi?id=60523

Ilgar Kovalyov  changed:

   What|Removed |Added

 Status|NEEDINFO|NEW

--- Comment #4 from Ilgar Kovalyov  ---
Answered in previous comment

-- 
You are receiving this mail because:
You are the assignee for the bug.
-
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org



[Bug 60523] Reduce number of network packets that server sends to client via WebSocket connection

2017-01-11 Thread bugzilla
https://bz.apache.org/bugzilla/show_bug.cgi?id=60523

--- Comment #3 from Ilgar Kovalyov  ---
Yes, it adds a couple of copies in memory but reduces number of network
packets.
Network packet transmission takes more time than operations with memory and we
have perfomance benefit sending less network packets.
If you wish this perfomance benefit can be checked by test.

-- 
You are receiving this mail because:
You are the assignee for the bug.
-
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org



[Bug 60523] Reduce number of network packets that server sends to client via WebSocket connection

2017-01-08 Thread bugzilla
https://bz.apache.org/bugzilla/show_bug.cgi?id=60523

--- Comment #2 from Ilgar Kovalyov  ---
(In reply to Mark Thomas from comment #1)
> What does this patch do to performance? It adds a couple of copies.

Yes, it adds a couple of copies in memory but reduces number of network
packets.
Network packet transmission takes more time than operations with memory and we
have perfomance benefit sending less network packets.
If you wish this perfomance benefit can be checked by test.

-- 
You are receiving this mail because:
You are the assignee for the bug.
-
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org



[Bug 60523] Reduce number of network packets that server sends to client via WebSocket connection

2017-01-03 Thread bugzilla
https://bz.apache.org/bugzilla/show_bug.cgi?id=60523

Mark Thomas  changed:

   What|Removed |Added

 Status|NEW |NEEDINFO

--- Comment #1 from Mark Thomas  ---
What does this patch do to performance? It adds a couple of copies.

-- 
You are receiving this mail because:
You are the assignee for the bug.
-
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org