[07/21/2023][15:35:48][15:35:48.780][3100][8544][][Server 192.168.0.1: Current total capacity: -485, current throughput: 4951
[07/21/2023][15:35:48][15:35:48.780][3100][8544][][Server 192.168.0.2: Current total capacity: 38.5, current throughput: 3.61
[07/21/2023][15:35:48][15:35:48.780][3100][8544][][Server 192.168.0.3: Current total capacity: 41.9, current throughput: 1.38
[07/21/2023][15:35:48][15:35:48.780][3100][8544][][Selected server 192.168.0.3: Current total capacity: 40.5, current throughput: 1.38][SmClient.cpp:3054][GetServer][][][][][][][][][][][][][][][][][][][][][][3][][][ACTIVE][3]
Why is the Policy Server capacity becoming negative?
Release : 12.8.x
This is when "EnableFailover=NO" in HCO or Clustering is used.
A rough formula is
Capacity = {Previous Capacity} - ( {Throughput} + {NewRequest} )
Throuput = {Previous Throuput} + {New Request}
To simplify things, this is based on a configuration where Policy Server has only 1 worker thread.
The Capacity can be negative when the Throughput value becomes greater than the Capacity.
Example:
Current stat: Capacity is 50, Throughput is 50
1 new request is received.
Then:
Capacity = {Previous Capacity} - ( {Throughput} + {NewRequest} )
= 50 - (50 + 1)
= -1
This is by design.
Note:
When a request is received:
1. WA tries to find the server that can handle the given request
Looking for "ACTIVE" Policy Servers.
2. Tries to find the Best Server among the ACTIVE servers.
Collects performance statistics such as average throughput, max throughput, etc
The algorithm compares the current capacity of all the policy servers and one with the highest value is considered to be the best.
When there is an INACTIVE server stats with >0, RecalibrateDistribution will kick in and reset INACTIVE server capacity to 0 and ACTIVE server capacity to 100.
Additionally, if capacity of all the PS comes out to be <=0, then also RecalibrateDistribution is called.