Skip to content

Commit 3809c04

Browse files
committed
impl new routing
requests are routed based on: busyness (lowest first), then generation (newest/highest first), then spawn time (oldest/lowest first)
1 parent 61739fd commit 3809c04

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

src/agent/Core/ApplicationPool/Group/ProcessListManagement.cpp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -152,9 +152,9 @@ Group::findBestProcessPreferringStickySessionId(unsigned int id) const {
152152
} else if (!process->isTotallyBusy()
153153
&& (
154154
bestProcess == nullptr
155-
|| process->generation > bestProcess->generation
156-
|| (process->generation == bestProcess->generation && process->spawnStartTime < bestProcess->spawnStartTime)
157-
|| (process->generation == bestProcess->generation && process->spawnStartTime == bestProcess->spawnStartTime && process->busyness() < bestProcess->busyness())
155+
|| (process->busyness() < bestProcess->busyness())
156+
|| (process->busyness() == bestProcess->busyness() && process->generation > bestProcess->generation)
157+
|| (process->busyness() == bestProcess->busyness() && process->generation == bestProcess->generation && process->spawnStartTime < bestProcess->spawnStartTime)
158158
)
159159
) {
160160
bestProcess = process;
@@ -189,9 +189,9 @@ Group::findBestProcess(const ProcessList &processes) const {
189189
if (!process->isTotallyBusy()
190190
&& (
191191
bestProcess == nullptr
192-
|| process->generation > bestProcess->generation
193-
|| (process->generation == bestProcess->generation && process->spawnStartTime < bestProcess->spawnStartTime)
194-
|| (process->generation == bestProcess->generation && process->spawnStartTime == bestProcess->spawnStartTime && process->busyness() < bestProcess->busyness())
192+
|| (process->busyness() < bestProcess->busyness())
193+
|| (process->busyness() == bestProcess->busyness() && process->generation > bestProcess->generation)
194+
|| (process->busyness() == bestProcess->busyness() && process->generation == bestProcess->generation && process->spawnStartTime < bestProcess->spawnStartTime)
195195
)
196196
) {
197197
bestProcess = process;

0 commit comments

Comments
 (0)