Uploaded image for project: 'ActiveMQ Classic'
  1. ActiveMQ Classic
  2. AMQ-9107

Closing many consumers causes CPU to spike to 100%

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • 5.17.1, 5.16.5
    • 5.18.0, 5.16.6, 5.17.3
    • None
    • None

    Description

      When there are many consumers (~188k) on a queue, closing them is incredibly expensive and causes the CPU to spike to 100% while the consumers are closed. Tested on an Amazon MQ mq.m5.large instance (2 vcpu, 8gb memory).

      I have attached a minimal recreation of the issue where the following happens: 

      1/ Open 100 connections.

      2/ Create consumers as fast as we can on all of those connections until we hit at least 188k consumers.

      3/ Sleep for 5 minutes so we can observe the CPU come back down after opening all those connections.

      4/ Start closing consumers as fast as we can.

      5/ After all consumers are closed, sleep for 5 minutes to observe the CPU come back down after closing all the connections.

       

      In this example it seems 5 minutes wasn't actually sufficient time for the CPU to come back down and the consumer and connection counts seem to hit 0 at the same time: 

       

      In a previous test with more time sleeping after closing all the consumers we can see the CPU come back down before we close the connections. 

      Attachments

        1. image-2022-10-07-00-17-30-657.png
          90 kB
          Lucas Tétreault
        2. image-2022-10-07-00-12-39-657.png
          89 kB
          Lucas Tétreault
        3. example.zip
          7 kB
          Lucas Tétreault

        Activity

          People

            jbonofre Jean-Baptiste Onofré
            tetlucas Lucas Tétreault
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Time Tracking

                Estimated:
                Original Estimate - Not Specified
                Not Specified
                Remaining:
                Remaining Estimate - 0h
                0h
                Logged:
                Time Spent - 3h 50m
                3h 50m