History | Log In     View a printable version of the current page.  
Issue Details (XML | Word | Printable)

Key: JM-657
Type: Improvement Improvement
Status: Closed Closed
Resolution: Fixed
Priority: Critical Critical
Assignee: Gaston Dombiak
Reporter: Gaston Dombiak
Votes: 0
Watchers: 0
Operations

If you were logged in you would be able to see more operations.
Openfire

Optimize algorithm used for sending packets to remote servers when new connections are required

Created: 04/21/06 10:39 AM   Updated: 12/11/06 12:42 PM
Component/s: Core
Affects Version/s: 2.6.2
Fix Version/s: 3.2.0 Beta

Time Tracking:
Not Specified

Support Plan Customer Issue: No
Resolution Date: 12/11/06 12:42 PM
Acceptance Test - Add?: No


 Description  « Hide
Current logic:

We have a queue of packets that need to be sent to remote servers for which a connection does not exist. There is a pool of threads that take packets from the pool, try to establish a connection to the remote server and then send the packet. The problem is that when many packets need to be sent to the same remote server then many threads from the pool will be used (one for each packet) and only one will be actually trying to establish the connection while the other threads are blocked. This algorithm does not scale well.

New logic:
Use the same thread to send all queued packets whose target is the same remote server. This will ensure a correct delivery order and will also leave the thread pool with threads available for sending packets to other servers.



 All   Comments   Work Log   Change History   Subversion Commits      Sort Order: Ascending order - Click to sort in descending order
Gaston Dombiak - 12/11/06 12:42 PM
This fix also fixes the packets out of order problem when sending packets to remote servers. However, the packet out of order is not fully fixed yet. There is also a problem while reading and processing the incoming traffic from remote servers. For each received packet (from the same server to the same target local entity) many threads will run in parallel thus breaking the order of the received packets.