<!-- mobian-agent-page publisher="dailydev" canonical="https://daily.dev/posts/unlocking-true-vertical-scalability-in-net-slashing-api-latency-from-10s-to-3s-on-azure-aks-xvwrgh4t1" -->

---
title: Unlocking True Vertical Scalability in .NET: Slashing...
description: A backend engineer shares how they resolved severe performance degradation in a C# data-processing API on Azure AKS. The API averaged 10-second response times...
canonical: https://daily.dev/posts/unlocking-true-vertical-scalability-in-net-slashing-api-latency-from-10s-to-3s-on-azure-aks-xvwrgh4t1
twitter:card: summary_large_image
twitter:site: @dailydotdev
og:type: website
og:site_name: daily.dev
og:title: Unlocking True Vertical Scalability in .NET: Slashing API Latency from 10s to 3s on Azure AKS | daily.dev
og:description: A backend engineer shares how they resolved severe performance degradation in a C# data-processing API on Azure AKS. The API averaged 10-second response times...
og:url: https://daily.dev/posts/unlocking-true-vertical-scalability-in-net-slashing-api-latency-from-10s-to-3s-on-azure-aks-xvwrgh4t1
og:image: https://api.daily.dev/og/posts/xvwRgh4T1.png
og:image:alt: Unlocking True Vertical Scalability in .NET: Slashing API Latency from 10s to 3s on Azure AKS
og:image:width: 1200
og:image:height: 630
og:locale: en
---

> ## Documentation Index
> Fetch the complete documentation index at: https://daily.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# Unlocking True Vertical Scalability in .NET: Slashing API Latency from 10s to 3s on Azure AKS

**[Medium](https://daily.dev/sources/medium_js)** · 4 min read · 7 upvotes · 0 comments

## Summary

A backend engineer shares how they resolved severe performance degradation in a C# data-processing API on Azure AKS. The API averaged 10-second response times under peak load, and vertical scaling made things worse due to thread pool starvation and lock contention. By migrating to TPL Dataflow with ActionBlock and TransformBlock, and dynamically tying parallelism to the container's CPU count, response times dropped to 3 seconds at 16,000 mcores. The post also explains why performance degraded again beyond that threshold, citing Amdahl's Law and NUMA architecture effects, and highlights the use of BenchmarkDotNet, GitHub Copilot's profiler agent, and Cursor with Grok 4.5 for diagnosis and refactoring.

## Full article

daily.dev links to this article rather than hosting it. Read it at the original source: <https://medium.com/@ingila185/unlocking-true-vertical-scalability-in-net-slashing-api-latency-from-10s-to-3s-on-azure-aks-e4581efb7820>

## Questions this post answers

### Why did my API get slower after vertically scaling up Kubernetes pod resources in Azure AKS?

Adding more compute can degrade performance when the application suffers from architectural thread contention, such as synchronous lock contention and thread pool starvation. Under high-core environments, more time gets spent on CPU thread context switches and fighting over shared locks than executing actual business logic, so hardware upgrades amplify the friction instead of resolving it.

_daily.dev surfaces posts like this for engineers debugging counterintuitive scaling regressions on Kubernetes._

### What causes performance to degrade again when a containerized workload is given too many CPU cores?

Excessive core counts can trigger a distributed systems phenomenon related to Amdahl's Law and NUMA (Non-Uniform Memory Access) architecture switching. When a container spans too many physical CPU sockets or virtual cores, the overhead of the OS coordinating thread scheduling across distinct hardware cache lines outpaces the actual computational work, causing latency to rise again beyond a certain core count.

_Teams tuning vertical scaling limits on daily.dev find real-world benchmarks like this useful for capacity planning._

### How can TPL Dataflow with ActionBlock and TransformBlock reduce lock contention in a C# data processing pipeline?

TPL Dataflow lets shared mutable state be replaced with immutable messages passed through separate execution stages using components like ActionBlock and TransformBlock, avoiding blocking locks entirely. Setting MaxDegreeOfParallelism dynamically to Environment.ProcessorCount times two allows the pipeline to scale its thread usage in line with the container's allocated core count, which helped cut API response times from 10 seconds to 3 seconds.

_Developers refactoring concurrent .NET pipelines track patterns like this on daily.dev before committing to a redesign._

## Similar posts on daily.dev

- [Today I will… find hidden latency across a distributed .NET application](https://daily.dev/posts/today-i-will-find-hidden-latency-across-a-distributed-net-application-37hqr8by1) · Visual Studio Blog · 8 upvotes · 0 comments
- [Keeping a Fast-Growing ABP Application Fast: What We Learned from Volobox](https://daily.dev/posts/keeping-a-fast-growing-abp-application-fast-what-we-learned-from-volobox-mjoy35v0o) · We Are .NET · 0 upvotes · 0 comments
- [.NET 11 Performance Gains That Matter for AI-Adjacent Backends — Daily DevOps & .NET](https://daily.dev/posts/net-11-performance-gains-that-matter-for-ai-adjacent-backends-daily-devops-net-25rrsf53j) · Daily DevOps & .NET · 28 upvotes · 2 comments
- [Engineering Speed at Scale — Architectural Lessons from Sub-100-ms APIs](https://daily.dev/posts/engineering-speed-at-scale-architectural-lessons-from-sub-100-ms-apis-jlkbvacta) · InfoQ · 0 upvotes · 0 comments

---

Tags: [#performance](https://daily.dev/tags/performance), [#azure](https://daily.dev/tags/azure), [#.net](https://daily.dev/tags/.net)

[View this post on daily.dev](https://daily.dev/posts/unlocking-true-vertical-scalability-in-net-slashing-api-latency-from-10s-to-3s-on-azure-aks-xvwrgh4t1)

```json
{"@context":"https://schema.org","@graph":[{"@type":"Organization","@id":"https://daily.dev/#organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180},"sameAs":["https://twitter.com/dailydotdev","https://github.com/dailydotdev","https://www.linkedin.com/company/daily-dev-ltd"]},{"@type":"WebSite","@id":"https://daily.dev/#website","url":"https://daily.dev","name":"daily.dev","publisher":{"@id":"https://daily.dev/#organization"},"potentialAction":{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https://daily.dev/search?q={search_term_string}"},"query-input":"required name=search_term_string"}}]}
{"@context":"https://schema.org","@type":"TechArticle","headline":"Unlocking True Vertical Scalability in .NET: Slashing API Latency from 10s to 3s on Azure AKS","url":"https://daily.dev/posts/unlocking-true-vertical-scalability-in-net-slashing-api-latency-from-10s-to-3s-on-azure-aks-xvwrgh4t1","mainEntityOfPage":{"@type":"WebPage","@id":"https://daily.dev/posts/unlocking-true-vertical-scalability-in-net-slashing-api-latency-from-10s-to-3s-on-azure-aks-xvwrgh4t1"},"datePublished":"2026-07-21T14:09:50.308Z","dateModified":"2026-09-13T20:05:00.101Z","description":"A backend engineer shares how they resolved severe performance degradation in a C# data-processing API on Azure AKS. The API averaged 10-second response times...","image":"https://media.daily.dev/image/upload/s--HRgLpUt6--/f_auto/v1722860399/public/Placeholder%2003","thumbnailUrl":"https://media.daily.dev/image/upload/s--HRgLpUt6--/f_auto/v1722860399/public/Placeholder%2003","isAccessibleForFree":true,"articleSection":"Medium","inLanguage":"en","publisher":{"@type":"Organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180}},"author":{"@type":"Organization","name":"Medium","logo":"https://media.daily.dev/image/upload/t_logo,f_auto/v1/logos/medium","url":"https://daily.dev/sources/medium_js"},"commentCount":0,"discussionUrl":"https://daily.dev/posts/unlocking-true-vertical-scalability-in-net-slashing-api-latency-from-10s-to-3s-on-azure-aks-xvwrgh4t1","interactionStatistic":[{"@type":"InteractionCounter","interactionType":{"@type":"LikeAction"},"userInteractionCount":7},{"@type":"InteractionCounter","interactionType":{"@type":"CommentAction"},"userInteractionCount":0}],"keywords":"performance,azure,.net","timeRequired":"PT4M"}
{"@context":"https://schema.org","@type":"BreadcrumbList","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https://daily.dev"},{"@type":"ListItem","position":2,"name":"Medium","item":"https://daily.dev/sources/medium_js"},{"@type":"ListItem","position":3,"name":"Unlocking True Vertical Scalability in .NET: Slashing API Latency from 10s to 3s on Azure AKS"}]}
{"@context":"https://schema.org","@type":"FAQPage","@id":"https://daily.dev/posts/unlocking-true-vertical-scalability-in-net-slashing-api-latency-from-10s-to-3s-on-azure-aks-xvwrgh4t1#faq","mainEntity":[{"@type":"Question","name":"Why did my API get slower after vertically scaling up Kubernetes pod resources in Azure AKS?","acceptedAnswer":{"@type":"Answer","text":"Adding more compute can degrade performance when the application suffers from architectural thread contention, such as synchronous lock contention and thread pool starvation. Under high-core environments, more time gets spent on CPU thread context switches and fighting over shared locks than executing actual business logic, so hardware upgrades amplify the friction instead of resolving it. daily.dev surfaces posts like this for engineers debugging counterintuitive scaling regressions on Kubernetes."}},{"@type":"Question","name":"What causes performance to degrade again when a containerized workload is given too many CPU cores?","acceptedAnswer":{"@type":"Answer","text":"Excessive core counts can trigger a distributed systems phenomenon related to Amdahl's Law and NUMA (Non-Uniform Memory Access) architecture switching. When a container spans too many physical CPU sockets or virtual cores, the overhead of the OS coordinating thread scheduling across distinct hardware cache lines outpaces the actual computational work, causing latency to rise again beyond a certain core count. Teams tuning vertical scaling limits on daily.dev find real-world benchmarks like this useful for capacity planning."}},{"@type":"Question","name":"How can TPL Dataflow with ActionBlock and TransformBlock reduce lock contention in a C# data processing pipeline?","acceptedAnswer":{"@type":"Answer","text":"TPL Dataflow lets shared mutable state be replaced with immutable messages passed through separate execution stages using components like ActionBlock and TransformBlock, avoiding blocking locks entirely. Setting MaxDegreeOfParallelism dynamically to Environment.ProcessorCount times two allows the pipeline to scale its thread usage in line with the container's allocated core count, which helped cut API response times from 10 seconds to 3 seconds. Developers refactoring concurrent .NET pipelines track patterns like this on daily.dev before committing to a redesign."}}]}
```

