Details

    • Type: Improvement Improvement
    • Status: Closed
    • Priority: Minor Minor
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 0.7
    • Component/s: BOSH
    • Labels:
      None

      Description

      There should be a single checking thread that will periodically check to see if there are sessions that passed their inactivity time.
      Right now this is done for every session with Timer.schedule that creates a thread for every session, which is not scalable (the number of threads increases linearly with the number of concurrent sessions).

        Activity

        Hide
        Ashish Paliwal added a comment -

        I don't think this is correct, that Timer.schedule will create a thread for every session.

        Here is note from javadoc

        This class scales to large numbers of concurrently scheduled tasks (thousands should present no problem). Internally, it uses a binary heap to represent its task queue, so the cost to schedule a task is O(log n), where n is the number of concurrently scheduled tasks.

        However, moving to a more simple approach is better.

        Show
        Ashish Paliwal added a comment - I don't think this is correct, that Timer.schedule will create a thread for every session. Here is note from javadoc This class scales to large numbers of concurrently scheduled tasks (thousands should present no problem). Internally, it uses a binary heap to represent its task queue, so the cost to schedule a task is O(log n), where n is the number of concurrently scheduled tasks. However, moving to a more simple approach is better.
        Hide
        Bogdan Pistol added a comment -

        You are right if you are using a single Timer instance to schedule n tasks. But in the current implementation there are n instances of Timer, and every instance is used to schedule 1 task, hence using n threads to schedule n tasks (for n sessions), which is inefficient.

        Show
        Bogdan Pistol added a comment - You are right if you are using a single Timer instance to schedule n tasks. But in the current implementation there are n instances of Timer, and every instance is used to schedule 1 task, hence using n threads to schedule n tasks (for n sessions), which is inefficient.
        Hide
        Bogdan Pistol added a comment -

        Committed in rev 1001557.

        Show
        Bogdan Pistol added a comment - Committed in rev 1001557.
        Hide
        Niklas Gustavsson added a comment -

        0.6 has already been released, so fix version should be 0.7

        Show
        Niklas Gustavsson added a comment - 0.6 has already been released, so fix version should be 0.7

          People

          • Assignee:
            Unassigned
            Reporter:
            Bogdan Pistol
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development