Skip to content

Commit c66e994

Browse files
authored
Disable NoGCRegion on Linux consumption. (#8687) (#8688)
1 parent 4e2d442 commit c66e994

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/WebJobs.Script.WebHost/Middleware/ClrOptimizationMiddleware.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ public ClrOptimizationMiddleware(RequestDelegate next, IScriptWebHostEnvironment
3131
_environment = environment;
3232
_logger = logger;
3333
_next = next;
34-
_invoke = InvokeClrOptimizationCheck;
34+
_invoke = _environment.IsAnyLinuxConsumption() ? next : InvokeClrOptimizationCheck;
3535
}
3636

3737
public Task Invoke(HttpContext context)
@@ -56,7 +56,7 @@ private void StartStopGCAsBestEffort()
5656
try
5757
{
5858
// optimization not intended for single core VMs
59-
if (_webHostEnvironment.InStandbyMode && _environment.GetEffectiveCoresCount() > 1)
59+
if (_webHostEnvironment.InStandbyMode && _environment.GetEffectiveCoresCount() > 1 && !_environment.IsAnyLinuxConsumption())
6060
{
6161
// If in placeholder mode and already in NoGCRegion, let's end it then start NoGCRegion again.
6262
// This may happen if there are multiple warmup calls(few minutes apart) during placeholder mode and before specialization.

0 commit comments

Comments
 (0)