SlideShare a Scribd company logo
.NET Core
Networking stack
and
Performance
.NET Core Summer event 2019 – Brno, CZ
Karel Zikmund ( @ziki_cz)
Agenda
• Networking stack architecture evolution
• .NET Framework, UWP and .NET Core
• Networking stack in .NET Core
• Direction and plans
• Status & perf results
• General BCL performance thoughts & observations
.NET Framework UWP .NET Core
Networking – Architecture Evolution
HttpWebRequest
+ ServicePoint
Sockets
SslStream,
Dns, …
Windows
HttpClient
+ HttpClientHandler
4.5
.NET Framework UWP .NET Core
Windows Linux / Mac
Sockets,
SslStream, …
Sockets
SslStream,
Dns, …
Windows
Networking – Architecture Evolution
HttpWebRequest
+ ServicePoint
Sockets
SslStream,
Dns, …
Windows
HttpClient
+ HttpClientHandler
4.5 HttpWebRequest
+ ServicePoint
HttpClient
+ HttpClientHandler
WinRT APIs
win9net.dll
HttpClient
WinHttpHandler
WinHttp.dll
CurlHandler
libcurl
OpenSSL
HttpWebRequest
+ ServicePoint
2.0
Networking – Architecture Evolution
.NET Framework
HttpWebRequest
+ ServicePoint
Sockets
SslStream,
Dns, …
Windows
HttpClient
+ HttpClientHandler
4.5
.NET Core
Windows Linux / Mac
Sockets,
SslStream, …
HttpClient
WinHttpHandler
WinHttp.dll
CurlHandler
libcurl
OpenSSL
HttpWebRequest
+ ServicePoint
2.0
Networking – Architecture Evolution
.NET Framework
HttpWebRequest
+ ServicePoint
Sockets
SslStream,
Dns, …
Windows
HttpClient
+ HttpClientHandler
4.5
.NET Core
Windows Linux / Mac
Sockets,
SslStream, …
HttpClient
WinHttpHandler
WinHttp.dll
CurlHandler
libcurl
OpenSSL
HttpWebRequest
+ ServicePoint
2.0
.NET Core 2.1
HttpWebRequest
+ ServicePoint
HttpClient
ManagedHandler
Windows Linux / Mac
OpenSSL
Sockets
SslStream,
Dns, …
Networking – Technical Roadmap
https://github.com/dotnet/designs/issues/9
1. Foundation – rock solid
• Sockets, SSL, DNS
2. Web stack (client) – high perf & consistency
• HttpClient, ClientWebSocket
3. Emerging technologies
• HTTP/2 … coming in .NET Core 3.0 as opt-in, mainly for gRPC scenarios
• RIO, QUIC
4. Maintenance components
• (Http/Ftp/File)WebRequest + ServicePoint, Mail, HttpListener
Networking – Investments
https://github.com/dotnet/designs/issues/9
1. Foundation – rock solid
• Sockets, SSL, DNS
2. Web stack (client) – high perf & consistency
• HttpClient, ClientWebSocket
3. Emerging technologies
• HTTP/2 … coming in .NET Core 3.0 as opt-in, mainly for gRPC scenarios
• RIO, QUIC
4. Maintenance components
• (Http/Ftp/File)WebRequest + ServicePoint, Mail, HttpListener
Networking – Investments short-term
SocketsHttpHandler – introduced in .NET Core 2.1 (1 year)
Next steps:
• Documentation (API / conceptual)
• Production diagnostics
• Testing – multi-machine, load / perf / stress automation
• High-perf scenarios – new APIs?
• Sync APIs on HttpClient/SocketsHttpHandler
• Backlog (15% of all CoreFX)
• More perf focus … of course
Networking – Focus on Perf
Scenarios / workloads:
• Micro-benchmarks vs. benchmarks vs. real-world scenarios (feedback)
Metrics:
• RPS (Response per second)
• Throughput
• Latency
• Connection density
Important properties:
• Percentiles (95% / 99%)
• Scale up
• Resources (CPU) utilization (90%-95% ideal)
Networking – Perf Test Environment
• Repeatability – isolated environment (reduce noise)
• 2 machines:
• 4-core
• 16 GB RAM
• 2x NIC: 1x 1 Gbps + 1x 10 Gbps
• 8 servers:
• 12-core
• 64 GB RAM
• 2x NIC: 1x 1 Gbps + 1x 40 Gbps
A B
External network
10 Gbps
1 Gbps 1 Gbps
External network
S.1 S.8…
40 Gbps
1 Gbps 1 Gbps 1 Gbps
Networking – Sockets Perf Results
• Micro-benchmark only (disclaimer: Netty/Go impl may be inefficient)
• Linux 2 CPUs:
• Gap for small payloads
(driver problem)
• SSL:
• 22% gap (to be investigated)
GB/s 256 B 4 KB 64 KB 1 MB
.NET Core 0.09 0.77 1.09 1.10
Netty 0.11 0.48 0.66 0.67
Go 0.12 0.82 1.10 1.11
SSL - GB/s 256 B 4 KB 64 KB 1 MB
.NET Core 0.04 0.31 0.71 0.87
Netty 0.03 0.12 0.15 0.15
Go 0.06 0.56 0.98 1.12
Networking – SocketsHttpHandler
• Introduced in .NET Core 2.1 … May 2018
• Windows: Parity with Go
• Linux: 15% gap against Windows (hard problem)
Networking – SSL Perf
• Indicators:
• Sockets micro-benchmarks (22% overhead)
• TechEmpower benchmark
• Customer reports
• Attempt for rewrite by community (@drawaes)
• Some end-to-end wins, but no micro-benchmark wins
• Next steps:
• Measure & analyze micro-benchmarks & end-to-end scenarios
Industry Benchmarks
• TechEmpower benchmark
• More end-to-end, with DB, etc.
• Useful for overall platform performance comparison
• Round 17
Industry Benchmarks - History
• Round 15 (from end of 2017 … 1.5 years old)
• ASP.NET Core at #5 entry (jump from #14 in Round 14)
Industry Benchmarks
Platform performance shows how fast your app could be, one day
… but it is not everything:
• Productivity
• Tooling
• Developer availability (in-house/to hire)
• Documentation
• Community
• etc.
Performance – Lessons Learned
• Plan for performance during design
• Understand scenario, set goals
• Prototype and measure early
• Optimize what’s important – measure
• Avoid micro-optimizations
• Understand the big picture
• Don’t guess root cause – measure
• Minimize repro – it’s worth it!
BCL Performance
• Fine-tuned over 15 years
• Opportunities are often trade-offs (memory vs. speed, etc.)
• How to identify scenarios which matter
• Customer feedback
• OSS helps:
• More eyes on code
• More reports
• Motivated contributors
• Perf improvements in .NET Core (.NET blog post by Stephen Toub)
• More Span/friends usage, arrays, strings, parsing, RegEx, Collections, Networking, IO
BCL Performance – What not to take?
• Specialized collections
• BCL designed for usability and decent perf for 95% customers
• Code complexity (maintainability) vs. perf wins
• APIs for specialized operations (e.g. to save duplicate lookup)
• Creates complexity
• May leak implementation into API surface
Wrap Up
• Proactive investments into .NET Networking stack
• Consistency across platforms
• Great performance for all workloads
• Ongoing scenario/feedback-based improvements in BCL perf
• Performance in general is:
• Important
• But not the only important thing
• Tricky to get right in the right place

More Related Content

PPTX
DotNext 2017 in Moscow - .NET Core Networking stack and Performance -- Karel ...
PDF
Making clouds: turning opennebula into a product
PDF
stackconf 2020 | Ignite talk: Opensource in Advanced Research Computing, How ...
PPTX
.Net Core 3.0. What’s inside? Павло Голубович
PDF
OSMC 2021 | Handling 250K flows per second with OpenNMS: a case study
PDF
OSMC 2021 | Advanced MySQL optimization and troubleshooting using PMM 2
PPTX
Ruby to Scala in 9 weeks
PDF
Understanding and Improving Code Generation
DotNext 2017 in Moscow - .NET Core Networking stack and Performance -- Karel ...
Making clouds: turning opennebula into a product
stackconf 2020 | Ignite talk: Opensource in Advanced Research Computing, How ...
.Net Core 3.0. What’s inside? Павло Голубович
OSMC 2021 | Handling 250K flows per second with OpenNMS: a case study
OSMC 2021 | Advanced MySQL optimization and troubleshooting using PMM 2
Ruby to Scala in 9 weeks
Understanding and Improving Code Generation

What's hot (20)

PPTX
Recent Advances in Machine Learning: Bringing a New Level of Intelligence to ...
PDF
Apache Flink @ Alibaba - Seattle Apache Flink Meetup
PDF
Migrating to Apache Spark at Netflix
PPTX
Architecture Sustaining LINE Sticker services
PPTX
A stream: Ad-hoc Shared Stream Processing - Jeyhun Karimov, DFKI GmbH
PPTX
Lessons Learned from Building and Operating Scuba
PDF
ZaloPay Merchant Platform on K8S on-premise
PDF
The Future of Real-Time in Spark
PPTX
Flink 1.0-slides
PDF
Metrics driven development with dedicated Observability Team
PDF
Kafka for Microservices – You absolutely need Avro Schemas! | Gerardo Gutierr...
PDF
Multi-DC Kafka
PDF
Virtual Flink Forward 2020: How Streaming Helps Your Staging Environment and ...
PPTX
Portable Streaming Pipelines with Apache Beam
PDF
Grokking Techtalk #34: K8S On-premise: Incident & Lesson Learned ZaloPay Mer...
PDF
Feature Hashing for Scalable Machine Learning with Nick Pentreath
PDF
Schemas Beyond The Edge
PDF
Spark Summit EU talk by Brij Bhushan Ravat
PDF
Unclouding Container Challenges
PDF
A Collaborative Data Science Development Workflow
Recent Advances in Machine Learning: Bringing a New Level of Intelligence to ...
Apache Flink @ Alibaba - Seattle Apache Flink Meetup
Migrating to Apache Spark at Netflix
Architecture Sustaining LINE Sticker services
A stream: Ad-hoc Shared Stream Processing - Jeyhun Karimov, DFKI GmbH
Lessons Learned from Building and Operating Scuba
ZaloPay Merchant Platform on K8S on-premise
The Future of Real-Time in Spark
Flink 1.0-slides
Metrics driven development with dedicated Observability Team
Kafka for Microservices – You absolutely need Avro Schemas! | Gerardo Gutierr...
Multi-DC Kafka
Virtual Flink Forward 2020: How Streaming Helps Your Staging Environment and ...
Portable Streaming Pipelines with Apache Beam
Grokking Techtalk #34: K8S On-premise: Incident & Lesson Learned ZaloPay Mer...
Feature Hashing for Scalable Machine Learning with Nick Pentreath
Schemas Beyond The Edge
Spark Summit EU talk by Brij Bhushan Ravat
Unclouding Container Challenges
A Collaborative Data Science Development Workflow
Ad

Similar to .NET Core Summer event 2019 in Brno, CZ - .NET Core Networking stack and performance -- Karel Zikmund (20)

PDF
Angular (v2 and up) - Morning to understand - Linagora
PPT
computer architecture.
PPTX
Seattle Spark Meetup Mobius CSharp API
PPTX
Introduction to DPDK
PPTX
Ceph Community Talk on High-Performance Solid Sate Ceph
PDF
Track A-2 基於 Spark 的數據分析
PPTX
Software Network Data Plane - Satisfying the need for speed - FD.io - VPP and...
PPTX
Retour d'expérience d'un environnement base de données multitenant
PDF
Stream Data Processing at Big Data Landscape by Oleksandr Fedirko
PPTX
Building FoundationDB
PPTX
Cognos Performance Tuning Tips & Tricks
PDF
Bitfusion Nimbix Dev Summit Heterogeneous Architectures
PDF
Dataplane networking acceleration with OpenDataplane / Максим Уваров (Linaro)
PPTX
Labview1_ Computer Applications in Control_ACRRL
PDF
"The Caffe2 Framework for Mobile and Embedded Deep Learning," a Presentation ...
PDF
P4_tutorial.pdf
PPTX
Our Methodology & Benefits
PDF
Understanding Android Benchmarks
PDF
Neotys PAC 2018 - Jonathon Wright
PDF
Unified Framework for Real Time, Near Real Time and Offline Analysis of Video...
Angular (v2 and up) - Morning to understand - Linagora
computer architecture.
Seattle Spark Meetup Mobius CSharp API
Introduction to DPDK
Ceph Community Talk on High-Performance Solid Sate Ceph
Track A-2 基於 Spark 的數據分析
Software Network Data Plane - Satisfying the need for speed - FD.io - VPP and...
Retour d'expérience d'un environnement base de données multitenant
Stream Data Processing at Big Data Landscape by Oleksandr Fedirko
Building FoundationDB
Cognos Performance Tuning Tips & Tricks
Bitfusion Nimbix Dev Summit Heterogeneous Architectures
Dataplane networking acceleration with OpenDataplane / Максим Уваров (Linaro)
Labview1_ Computer Applications in Control_ACRRL
"The Caffe2 Framework for Mobile and Embedded Deep Learning," a Presentation ...
P4_tutorial.pdf
Our Methodology & Benefits
Understanding Android Benchmarks
Neotys PAC 2018 - Jonathon Wright
Unified Framework for Real Time, Near Real Time and Offline Analysis of Video...
Ad

More from Karel Zikmund (20)

PPTX
.NET Conf 2022 - Networking in .NET 7
PPTX
NDC London 2020 - Challenges of Managing CoreFx Repo -- Karel Zikmund
PPTX
NDC Sydney 2019 - Async Demystified -- Karel Zikmund
PPTX
WUG Days 2022 Brno - Networking in .NET 7.0 and YARP -- Karel Zikmund
PDF
.NET Core Summer event 2019 in Vienna, AT - .NET 5 - Future of .NET on Mobile...
PPTX
.NET Core Summer event 2019 in Linz, AT - War stories from .NET team -- Karel...
PPTX
.NET Core Summer event 2019 in Brno, CZ - Async demystified -- Karel Zikmund
PPTX
.NET Core Summer event 2019 in Brno, CZ - War stories from .NET team -- Karel...
PPTX
.NET Core Summer event 2019 in Prague, CZ - War stories from .NET team -- Kar...
PPTX
.NET Core Summer event 2019 in Vienna, AT - War stories from .NET team -- Kar...
PPTX
.NET Core Summer event 2019 in NL - War stories from .NET team -- Karel Zikmund
PPTX
NDC Oslo 2019 - War stories from .NET team -- Karel Zikmund
PPTX
DotNext 2017 in Moscow - Challenges of Managing CoreFX repo -- Karel Zikmund
PPTX
.NET MeetUp Brno 2017 - Microsoft Engineering teams in Europe -- Karel Zikmund
PPTX
.NET MeetUp Brno 2017 - Xamarin .NET internals -- Marek Safar
PPTX
.NET MeetUp Brno - Challenges of Managing CoreFX repo -- Karel Zikmund
PPTX
.NET Fringe 2017 - Challenges of Managing CoreFX repo -- Karel Zikmund
PPTX
.NET MeetUp Prague 2017 - Challenges of Managing CoreFX repo -- Karel Zikmund
PPTX
.NET MeetUp Prague 2017 - .NET Standard -- Karel Zikmund
PPTX
.NET MeetUp Amsterdam 2017 - Challenges of Managing CoreFX repo -- Karel Zikmund
.NET Conf 2022 - Networking in .NET 7
NDC London 2020 - Challenges of Managing CoreFx Repo -- Karel Zikmund
NDC Sydney 2019 - Async Demystified -- Karel Zikmund
WUG Days 2022 Brno - Networking in .NET 7.0 and YARP -- Karel Zikmund
.NET Core Summer event 2019 in Vienna, AT - .NET 5 - Future of .NET on Mobile...
.NET Core Summer event 2019 in Linz, AT - War stories from .NET team -- Karel...
.NET Core Summer event 2019 in Brno, CZ - Async demystified -- Karel Zikmund
.NET Core Summer event 2019 in Brno, CZ - War stories from .NET team -- Karel...
.NET Core Summer event 2019 in Prague, CZ - War stories from .NET team -- Kar...
.NET Core Summer event 2019 in Vienna, AT - War stories from .NET team -- Kar...
.NET Core Summer event 2019 in NL - War stories from .NET team -- Karel Zikmund
NDC Oslo 2019 - War stories from .NET team -- Karel Zikmund
DotNext 2017 in Moscow - Challenges of Managing CoreFX repo -- Karel Zikmund
.NET MeetUp Brno 2017 - Microsoft Engineering teams in Europe -- Karel Zikmund
.NET MeetUp Brno 2017 - Xamarin .NET internals -- Marek Safar
.NET MeetUp Brno - Challenges of Managing CoreFX repo -- Karel Zikmund
.NET Fringe 2017 - Challenges of Managing CoreFX repo -- Karel Zikmund
.NET MeetUp Prague 2017 - Challenges of Managing CoreFX repo -- Karel Zikmund
.NET MeetUp Prague 2017 - .NET Standard -- Karel Zikmund
.NET MeetUp Amsterdam 2017 - Challenges of Managing CoreFX repo -- Karel Zikmund

Recently uploaded (20)

PPTX
Introduction to Artificial Intelligence
PDF
T3DD25 TYPO3 Content Blocks - Deep Dive by André Kraus
PPTX
Agentic AI Use Case- Contract Lifecycle Management (CLM).pptx
PPTX
ManageIQ - Sprint 268 Review - Slide Deck
PDF
How to Migrate SBCGlobal Email to Yahoo Easily
PDF
2025 Textile ERP Trends: SAP, Odoo & Oracle
PDF
Digital Strategies for Manufacturing Companies
PDF
Design an Analysis of Algorithms II-SECS-1021-03
PDF
Addressing The Cult of Project Management Tools-Why Disconnected Work is Hold...
PDF
Raksha Bandhan Grocery Pricing Trends in India 2025.pdf
PPTX
Odoo POS Development Services by CandidRoot Solutions
PDF
Claude Code: Everyone is a 10x Developer - A Comprehensive AI-Powered CLI Tool
PDF
Design an Analysis of Algorithms I-SECS-1021-03
PDF
Navsoft: AI-Powered Business Solutions & Custom Software Development
PPTX
L1 - Introduction to python Backend.pptx
PPTX
history of c programming in notes for students .pptx
PPT
Introduction Database Management System for Course Database
PPTX
Oracle E-Business Suite: A Comprehensive Guide for Modern Enterprises
PDF
Wondershare Filmora 15 Crack With Activation Key [2025
PDF
Flood Susceptibility Mapping Using Image-Based 2D-CNN Deep Learnin. Overview ...
Introduction to Artificial Intelligence
T3DD25 TYPO3 Content Blocks - Deep Dive by André Kraus
Agentic AI Use Case- Contract Lifecycle Management (CLM).pptx
ManageIQ - Sprint 268 Review - Slide Deck
How to Migrate SBCGlobal Email to Yahoo Easily
2025 Textile ERP Trends: SAP, Odoo & Oracle
Digital Strategies for Manufacturing Companies
Design an Analysis of Algorithms II-SECS-1021-03
Addressing The Cult of Project Management Tools-Why Disconnected Work is Hold...
Raksha Bandhan Grocery Pricing Trends in India 2025.pdf
Odoo POS Development Services by CandidRoot Solutions
Claude Code: Everyone is a 10x Developer - A Comprehensive AI-Powered CLI Tool
Design an Analysis of Algorithms I-SECS-1021-03
Navsoft: AI-Powered Business Solutions & Custom Software Development
L1 - Introduction to python Backend.pptx
history of c programming in notes for students .pptx
Introduction Database Management System for Course Database
Oracle E-Business Suite: A Comprehensive Guide for Modern Enterprises
Wondershare Filmora 15 Crack With Activation Key [2025
Flood Susceptibility Mapping Using Image-Based 2D-CNN Deep Learnin. Overview ...

.NET Core Summer event 2019 in Brno, CZ - .NET Core Networking stack and performance -- Karel Zikmund

  • 1. .NET Core Networking stack and Performance .NET Core Summer event 2019 – Brno, CZ Karel Zikmund ( @ziki_cz)
  • 2. Agenda • Networking stack architecture evolution • .NET Framework, UWP and .NET Core • Networking stack in .NET Core • Direction and plans • Status & perf results • General BCL performance thoughts & observations
  • 3. .NET Framework UWP .NET Core Networking – Architecture Evolution HttpWebRequest + ServicePoint Sockets SslStream, Dns, … Windows HttpClient + HttpClientHandler 4.5
  • 4. .NET Framework UWP .NET Core Windows Linux / Mac Sockets, SslStream, … Sockets SslStream, Dns, … Windows Networking – Architecture Evolution HttpWebRequest + ServicePoint Sockets SslStream, Dns, … Windows HttpClient + HttpClientHandler 4.5 HttpWebRequest + ServicePoint HttpClient + HttpClientHandler WinRT APIs win9net.dll HttpClient WinHttpHandler WinHttp.dll CurlHandler libcurl OpenSSL HttpWebRequest + ServicePoint 2.0
  • 5. Networking – Architecture Evolution .NET Framework HttpWebRequest + ServicePoint Sockets SslStream, Dns, … Windows HttpClient + HttpClientHandler 4.5 .NET Core Windows Linux / Mac Sockets, SslStream, … HttpClient WinHttpHandler WinHttp.dll CurlHandler libcurl OpenSSL HttpWebRequest + ServicePoint 2.0
  • 6. Networking – Architecture Evolution .NET Framework HttpWebRequest + ServicePoint Sockets SslStream, Dns, … Windows HttpClient + HttpClientHandler 4.5 .NET Core Windows Linux / Mac Sockets, SslStream, … HttpClient WinHttpHandler WinHttp.dll CurlHandler libcurl OpenSSL HttpWebRequest + ServicePoint 2.0 .NET Core 2.1 HttpWebRequest + ServicePoint HttpClient ManagedHandler Windows Linux / Mac OpenSSL Sockets SslStream, Dns, …
  • 7. Networking – Technical Roadmap https://github.com/dotnet/designs/issues/9 1. Foundation – rock solid • Sockets, SSL, DNS 2. Web stack (client) – high perf & consistency • HttpClient, ClientWebSocket 3. Emerging technologies • HTTP/2 … coming in .NET Core 3.0 as opt-in, mainly for gRPC scenarios • RIO, QUIC 4. Maintenance components • (Http/Ftp/File)WebRequest + ServicePoint, Mail, HttpListener
  • 8. Networking – Investments https://github.com/dotnet/designs/issues/9 1. Foundation – rock solid • Sockets, SSL, DNS 2. Web stack (client) – high perf & consistency • HttpClient, ClientWebSocket 3. Emerging technologies • HTTP/2 … coming in .NET Core 3.0 as opt-in, mainly for gRPC scenarios • RIO, QUIC 4. Maintenance components • (Http/Ftp/File)WebRequest + ServicePoint, Mail, HttpListener
  • 9. Networking – Investments short-term SocketsHttpHandler – introduced in .NET Core 2.1 (1 year) Next steps: • Documentation (API / conceptual) • Production diagnostics • Testing – multi-machine, load / perf / stress automation • High-perf scenarios – new APIs? • Sync APIs on HttpClient/SocketsHttpHandler • Backlog (15% of all CoreFX) • More perf focus … of course
  • 10. Networking – Focus on Perf Scenarios / workloads: • Micro-benchmarks vs. benchmarks vs. real-world scenarios (feedback) Metrics: • RPS (Response per second) • Throughput • Latency • Connection density Important properties: • Percentiles (95% / 99%) • Scale up • Resources (CPU) utilization (90%-95% ideal)
  • 11. Networking – Perf Test Environment • Repeatability – isolated environment (reduce noise) • 2 machines: • 4-core • 16 GB RAM • 2x NIC: 1x 1 Gbps + 1x 10 Gbps • 8 servers: • 12-core • 64 GB RAM • 2x NIC: 1x 1 Gbps + 1x 40 Gbps A B External network 10 Gbps 1 Gbps 1 Gbps External network S.1 S.8… 40 Gbps 1 Gbps 1 Gbps 1 Gbps
  • 12. Networking – Sockets Perf Results • Micro-benchmark only (disclaimer: Netty/Go impl may be inefficient) • Linux 2 CPUs: • Gap for small payloads (driver problem) • SSL: • 22% gap (to be investigated) GB/s 256 B 4 KB 64 KB 1 MB .NET Core 0.09 0.77 1.09 1.10 Netty 0.11 0.48 0.66 0.67 Go 0.12 0.82 1.10 1.11 SSL - GB/s 256 B 4 KB 64 KB 1 MB .NET Core 0.04 0.31 0.71 0.87 Netty 0.03 0.12 0.15 0.15 Go 0.06 0.56 0.98 1.12
  • 13. Networking – SocketsHttpHandler • Introduced in .NET Core 2.1 … May 2018 • Windows: Parity with Go • Linux: 15% gap against Windows (hard problem)
  • 14. Networking – SSL Perf • Indicators: • Sockets micro-benchmarks (22% overhead) • TechEmpower benchmark • Customer reports • Attempt for rewrite by community (@drawaes) • Some end-to-end wins, but no micro-benchmark wins • Next steps: • Measure & analyze micro-benchmarks & end-to-end scenarios
  • 15. Industry Benchmarks • TechEmpower benchmark • More end-to-end, with DB, etc. • Useful for overall platform performance comparison • Round 17
  • 16. Industry Benchmarks - History • Round 15 (from end of 2017 … 1.5 years old) • ASP.NET Core at #5 entry (jump from #14 in Round 14)
  • 17. Industry Benchmarks Platform performance shows how fast your app could be, one day … but it is not everything: • Productivity • Tooling • Developer availability (in-house/to hire) • Documentation • Community • etc.
  • 18. Performance – Lessons Learned • Plan for performance during design • Understand scenario, set goals • Prototype and measure early • Optimize what’s important – measure • Avoid micro-optimizations • Understand the big picture • Don’t guess root cause – measure • Minimize repro – it’s worth it!
  • 19. BCL Performance • Fine-tuned over 15 years • Opportunities are often trade-offs (memory vs. speed, etc.) • How to identify scenarios which matter • Customer feedback • OSS helps: • More eyes on code • More reports • Motivated contributors • Perf improvements in .NET Core (.NET blog post by Stephen Toub) • More Span/friends usage, arrays, strings, parsing, RegEx, Collections, Networking, IO
  • 20. BCL Performance – What not to take? • Specialized collections • BCL designed for usability and decent perf for 95% customers • Code complexity (maintainability) vs. perf wins • APIs for specialized operations (e.g. to save duplicate lookup) • Creates complexity • May leak implementation into API surface
  • 21. Wrap Up • Proactive investments into .NET Networking stack • Consistency across platforms • Great performance for all workloads • Ongoing scenario/feedback-based improvements in BCL perf • Performance in general is: • Important • But not the only important thing • Tricky to get right in the right place

Editor's Notes

  • #3: Why Networking? Networking is even more important in many modern workloads – microservices, Cloud I work on team making some of these cool investments in Networking and BCL These are NOT the only investments in BCL and .NET/.NET Core – just those I have close relation to at my daily job
  • #4: Client stack HttpWebRequest since .NET 1.0 Exceptions on errors (404) 4.5 added HttpClient, driven by WCF Pipeline architecture (extensibility) No http2 support Original plan to later re-wire HttpClient directly on fundamentals – huge compat!!!
  • #5: UWP: WinRT APIs designed by Windows Networking team at he same time as 4.5 – almost 1:1 mapping win9net.dll is client library - http2 support .NET Core: http2 support – server library HttpWebRequest for compatibility in .NET Core 2.0 (.NET Standard 2.0), but “obsoleted” libcurl with NSS, not just OpenSSL Different behaviors on different OS’s or even Linux distros – inconsistencies in behavior
  • #7: Key values: Consistency and Perf wins
  • #8: Foundation – performance (& reliability) Usable for both server and client scenarios Web stack – consistency & performance (& reliability) Important for middleware scenarios (not just 1 server) Emerging technologies – new protocols, capabilities and performance motivated RIO = Registered I/O (Win8+) QUIC = Quick UDP Internet Protocol (TCP/TSL replacement) … Latency improvements (esp. for streaming) Maintenance components – minimal investments – mostly for reliability and the most necessary standards support (preserve customers’ investments)
  • #9: Foundation – performance (& reliability) Usable for both server and client scenarios Web stack – consistency & performance (& reliability) Important for middleware scenarios (not just 1 server) Emerging technologies – new protocols, capabilities and performance motivated RIO = Registered I/O (Win8+) QUIC = Quick UDP Internet Protocol (TCP/TSL replacement) … Latency improvements (esp. for streaming) Maintenance components – minimal investments – mostly for reliability and the most necessary standards support (preserve customers’ investments)
  • #11: RPS (Response per second) – e.g. web servers Throughput – e.g. streaming video/music Latency – e.g. real-time trading Connection density – e.g. messaging services, IoT/devices
  • #12: Repeatability Non-networking micro-benchmarks – time (wallclock), memory … classic CLR perf lab disables many OS features Cloud (Azure) attempt Full control of environment needed
  • #13: Example how we measure perf and compare, not statement about platform comparison Column is payload size (1B -> 1MB, each column is 16x bigger than previous one) Note: RPS as metric in second table better tells the story of scaling based on payload size 22% gap on SSL against Go Note: .NET Core 1.1 was at 0.47 GB/s at 1MB – 2x improvement in 2.0/2.1
  • #15: Sockets micro-benchmarks – 22% gap TechEmpower benchmark - http vs. https larger diff than other platforms Historical reports on some .NET Framework scenarios: https vs. http
  • #18: Warning: Not everyone builds hyper-scale service Even if you think you are, don’t forget that most scaling apps are rewritten every 2-3 years You don’t have to be perfect on day 1, evolve over time
  • #19: Design performance E.g. for micro-services architecture, model the workloads, use fake data / CPU/network utilization Optimize what’s important: 90-10 rule (95-5) … what contributes to app performance Story: Arguing over d.s. List vs. array when the data is <100 items and the service has 3 hops between servers Guess root cause mistakes: Conclusions based on 1 dump (or 2 in better case)
  • #20: Thousands of APIs, hard to pick the right ones Problem: Using telemetry from MS/partners, partner teams reports, working closely with customers and community OSS: We often ask about the scenario, to understand the big picture Examples: (quite often 30% and more)