Uploaded image for project: 'Openfire (ARCHIVED)'
  1. JM-657

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

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Critical
    • Resolution: Fixed
    • Affects versions: 2.6.2
    • Fix versions: 3.2.0 Beta
    • Components: Core
    • Labels:
      None

      Description

      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.

        Attachments

          Activity

            People

            • Assignee:
              Gaston Dombiak
              Reporter:
              Gaston Dombiak
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: