Uploaded image for project: 'Solr'
  1. Solr
  2. SOLR-15056

CPU circuit breaker needs to use CPU utilization, not Unix load average

Attach filesAttach ScreenshotAdd voteVotersWatch issueWatchersCreate sub-taskLinkCloneUpdate Comment AuthorReplace String in CommentUpdate Comment VisibilityDelete Comments


    • Type: Bug
    • Status: Open
    • Priority: Major
    • Resolution: Unresolved
    • Affects Version/s: 8.7
    • Fix Version/s: None
    • Component/s: metrics
    • Labels:


      The config range, 50% to 95%, assumes that the circuit breaker is triggered by a CPU utilization metric that goes from 0% to 100%. But the code uses the metric OperatingSystemMXBean.getSystemLoadAverage(). That is an average of the count of processes waiting to run. It is effectively unbounded. I've seen it as high as 50 to 100. It is not bound by 1.0 (100%).

      A good limit for load average would need to be aware of the number of CPUs available to the JVM. A load average of 8 is no problem for a 32 CPU host. It is a critical situation for a 2 CPU host.

      Also, load average is a Unix OS metric. I don't know if it is even available on Windows.

      Instead, use a CPU utilization metric that goes from 0.0 to 1.0. A good choice is OperatingSystemMXBean.getSystemCPULoad(). This name also uses "load", but it is a usage metric.

      From the Javadoc:

      > Returns the "recent cpu usage" for the whole system. This value is a double in the [0.0,1.0] interval. A value of 0.0 means that all CPUs were idle during the recent period of time observed, while a value of 1.0 means that all CPUs were actively running 100% of the time during the recent period being observed. All values betweens 0.0 and 1.0 are possible depending of the activities going on in the system. If the system recent cpu usage is not available, the method returns a negative value.


      Also update the documentation to explain which JMX metrics are used for the memory and CPU circuit breakers.



        Issue Links



            • Assignee:
              atri Atri Sharma
              wunder Walter Underwood


              • Created:

                Time Tracking

                Original Estimate - Not Specified
                Not Specified
                Remaining Estimate - 0h
                Time Spent - 6h 50m
                6h 50m

                  Issue deployment