You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: core/invoker/src/main/resources/application.conf
+3-1
Original file line number
Diff line number
Diff line change
@@ -60,7 +60,9 @@ whisk {
60
60
user-memory: 1024 m
61
61
concurrent-peek-factor: 0.5 #factor used to limit message peeking: 0 < factor <= 1.0 - larger number improves concurrent processing, but increases risk of message loss during invoker crash
62
62
akka-client: false # if true, use PoolingContainerClient for HTTP from invoker to action container (otherwise use ApacheBlockingContainerClient)
63
-
prewarm-expiration-check-interval: 1 minute
63
+
prewarm-expiration-check-interval: 1 minute # period to check for prewarm expiration
64
+
prewarm-expiration-check-interval-variance: 10 seconds # varies expiration across invokers to avoid many concurrent expirations
65
+
prewarm-expiration-limit: 100 # number of prewarms to expire in one expiration cycle (remaining expired will be considered for expiration in next cycle)
.sortBy(_._2) //need to sort these so that if the results are limited, we take the oldest
605
+
.map(_._1)
606
+
if (expireds.nonEmpty) {
607
+
logging.info(this, s"removing up to ${poolConfig.prewarmExpirationLimit} of ${expireds.size} expired containers")
608
+
expireds.take(poolConfig.prewarmExpirationLimit).foreach { e =>
609
+
prewarmedPool.get(e).map { d =>
610
+
logging.info(this, s"removing expired prewarm of kind ${d.kind} with container ${d.container}")
583
611
}
584
-
.getOrElse(List.empty)
612
+
}
585
613
}
614
+
expireds.take(poolConfig.prewarmExpirationLimit)
586
615
}
587
616
588
617
/**
@@ -609,8 +638,8 @@ object ContainerPool {
609
638
valmemory= config.memoryLimit
610
639
611
640
valrunningCount= prewarmedPool.count {
612
-
// done starting, and not expired
613
-
case (_, p @PreWarmedData(_, `kind`, `memory`, _, _)) if!p.isExpired() =>true
641
+
// done starting (include expired, since they may not have been removed yet)
642
+
case (_, p @PreWarmedData(_, `kind`, `memory`, _, _)) =>true
614
643
// started but not finished starting (or expired)
615
644
case _ =>false
616
645
}
@@ -632,10 +661,12 @@ object ContainerPool {
632
661
}
633
662
}
634
663
635
-
logging.info(
636
-
this,
637
-
s"found ${currentCount} started and ${startingCount} starting; ${if (init) "initing"else"backfilling"}${desiredCount - currentCount} pre-warms to desired count: ${desiredCount} for kind:${config.exec.kind} mem:${config.memoryLimit.toString}")(
638
-
TransactionId.invokerWarmup)
664
+
if (currentCount < desiredCount) {
665
+
logging.info(
666
+
this,
667
+
s"found ${currentCount} started and ${startingCount} starting; ${if (init) "initing"else"backfilling"}${desiredCount - currentCount} pre-warms to desired count: ${desiredCount} for kind:${config.exec.kind} mem:${config.memoryLimit.toString}")(
0 commit comments