oded coster - stack overflow behind the scenes - how it's made - codemotion milan 2017
TRANSCRIPT
![Page 1: Oded Coster - Stack Overflow behind the scenes - how it's made - Codemotion Milan 2017](https://reader033.vdocuments.net/reader033/viewer/2022051710/5a6479c67f8b9a40568b47bf/html5/thumbnails/1.jpg)
All slides are licensed CC BY-NC-SA 3.0
Stack Overflow Behind the ScenesOded Coster - @OdedCoster
CODEMOTION MILAN - SPECIAL EDITION
10 – 11 NOVEMBER 2017
![Page 2: Oded Coster - Stack Overflow behind the scenes - how it's made - Codemotion Milan 2017](https://reader033.vdocuments.net/reader033/viewer/2022051710/5a6479c67f8b9a40568b47bf/html5/thumbnails/2.jpg)
All slides are licensed CC BY-NC-SA 3.0
Who Am I?• Nearly 5 years at Stack Overflow
![Page 3: Oded Coster - Stack Overflow behind the scenes - how it's made - Codemotion Milan 2017](https://reader033.vdocuments.net/reader033/viewer/2022051710/5a6479c67f8b9a40568b47bf/html5/thumbnails/3.jpg)
All slides are licensed CC BY-NC-SA 3.0
Overview
• The numbers
• Teamwork
• Web platform
• Scaling/Performance
• The Cloud
![Page 4: Oded Coster - Stack Overflow behind the scenes - how it's made - Codemotion Milan 2017](https://reader033.vdocuments.net/reader033/viewer/2022051710/5a6479c67f8b9a40568b47bf/html5/thumbnails/4.jpg)
All slides are licensed CC BY-NC-SA 3.0
The Numbers
For Stack Overflow and all other Q&A sites and the different services (chat, stackexchange.com, Talent, Business etc…)
![Page 5: Oded Coster - Stack Overflow behind the scenes - how it's made - Codemotion Milan 2017](https://reader033.vdocuments.net/reader033/viewer/2022051710/5a6479c67f8b9a40568b47bf/html5/thumbnails/5.jpg)
All slides are licensed CC BY-NC-SA 3.0
1.3 Billion
Page Views per Month
![Page 6: Oded Coster - Stack Overflow behind the scenes - how it's made - Codemotion Milan 2017](https://reader033.vdocuments.net/reader033/viewer/2022051710/5a6479c67f8b9a40568b47bf/html5/thumbnails/6.jpg)
All slides are licensed CC BY-NC-SA 3.0
370 Million
HTTP requests a day
(CDN gets another 3.7 billion)
that’s 99.9% cached!
![Page 7: Oded Coster - Stack Overflow behind the scenes - how it's made - Codemotion Milan 2017](https://reader033.vdocuments.net/reader033/viewer/2022051710/5a6479c67f8b9a40568b47bf/html5/thumbnails/7.jpg)
All slides are licensed CC BY-NC-SA 3.0
528 Million
Stack Overflow database Queries a Day
(11,000 queries/second at peak)
![Page 8: Oded Coster - Stack Overflow behind the scenes - how it's made - Codemotion Milan 2017](https://reader033.vdocuments.net/reader033/viewer/2022051710/5a6479c67f8b9a40568b47bf/html5/thumbnails/8.jpg)
All slides are licensed CC BY-NC-SA 3.0
3.75 Billion
Redis operations a Day
(60,000 operations a second)
![Page 9: Oded Coster - Stack Overflow behind the scenes - how it's made - Codemotion Milan 2017](https://reader033.vdocuments.net/reader033/viewer/2022051710/5a6479c67f8b9a40568b47bf/html5/thumbnails/9.jpg)
All slides are licensed CC BY-NC-SA 3.0
3,644
Tag Engine Requests per Minute
![Page 10: Oded Coster - Stack Overflow behind the scenes - how it's made - Codemotion Milan 2017](https://reader033.vdocuments.net/reader033/viewer/2022051710/5a6479c67f8b9a40568b47bf/html5/thumbnails/10.jpg)
All slides are licensed CC BY-NC-SA 3.0
34 Million
Elasticsearch Searches per Day
![Page 11: Oded Coster - Stack Overflow behind the scenes - how it's made - Codemotion Milan 2017](https://reader033.vdocuments.net/reader033/viewer/2022051710/5a6479c67f8b9a40568b47bf/html5/thumbnails/11.jpg)
All slides are licensed CC BY-NC-SA 3.0
600,000
Sustained web socket connections
(15,000 connections/second at peak)
![Page 12: Oded Coster - Stack Overflow behind the scenes - how it's made - Codemotion Milan 2017](https://reader033.vdocuments.net/reader033/viewer/2022051710/5a6479c67f8b9a40568b47bf/html5/thumbnails/12.jpg)
All slides are licensed CC BY-NC-SA 3.0
5.5 Billion
HAProxy Requests per Months
(4,500 requests/second at peak)
![Page 13: Oded Coster - Stack Overflow behind the scenes - how it's made - Codemotion Milan 2017](https://reader033.vdocuments.net/reader033/viewer/2022051710/5a6479c67f8b9a40568b47bf/html5/thumbnails/13.jpg)
All slides are licensed CC BY-NC-SA 3.0
55 Terabytes
Transferred a Month
![Page 14: Oded Coster - Stack Overflow behind the scenes - how it's made - Codemotion Milan 2017](https://reader033.vdocuments.net/reader033/viewer/2022051710/5a6479c67f8b9a40568b47bf/html5/thumbnails/14.jpg)
All slides are licensed CC BY-NC-SA 3.0
The NumbersHardware
![Page 15: Oded Coster - Stack Overflow behind the scenes - how it's made - Codemotion Milan 2017](https://reader033.vdocuments.net/reader033/viewer/2022051710/5a6479c67f8b9a40568b47bf/html5/thumbnails/15.jpg)
All slides are licensed CC BY-NC-SA 3.0
2 Microsoft SQL Servers
(1 is a read-only replica)
1.5TB Ram, 16 cores * 2
(Stack Overflow)
![Page 16: Oded Coster - Stack Overflow behind the scenes - how it's made - Codemotion Milan 2017](https://reader033.vdocuments.net/reader033/viewer/2022051710/5a6479c67f8b9a40568b47bf/html5/thumbnails/16.jpg)
All slides are licensed CC BY-NC-SA 3.0
2 Microsoft SQL Servers
(1 is a read-only replica)
768GB Ram, 8 cores * 2
(rest of network)
![Page 17: Oded Coster - Stack Overflow behind the scenes - how it's made - Codemotion Milan 2017](https://reader033.vdocuments.net/reader033/viewer/2022051710/5a6479c67f8b9a40568b47bf/html5/thumbnails/17.jpg)
All slides are licensed CC BY-NC-SA 3.0
9 IIS Web Servers
(+2 for staging)
64 GB Ram, 12 cores * 2
![Page 18: Oded Coster - Stack Overflow behind the scenes - how it's made - Codemotion Milan 2017](https://reader033.vdocuments.net/reader033/viewer/2022051710/5a6479c67f8b9a40568b47bf/html5/thumbnails/18.jpg)
All slides are licensed CC BY-NC-SA 3.0
2 Redis Servers
256 GB Ram, 10 cores * 2
![Page 19: Oded Coster - Stack Overflow behind the scenes - how it's made - Codemotion Milan 2017](https://reader033.vdocuments.net/reader033/viewer/2022051710/5a6479c67f8b9a40568b47bf/html5/thumbnails/19.jpg)
All slides are licensed CC BY-NC-SA 3.0
3 Tag Engine Servers
(really service boxes)
64 GB Ram, 6 cores * 2 (2)
32 GB Ram, 6 cores * 2 (1)
![Page 20: Oded Coster - Stack Overflow behind the scenes - how it's made - Codemotion Milan 2017](https://reader033.vdocuments.net/reader033/viewer/2022051710/5a6479c67f8b9a40568b47bf/html5/thumbnails/20.jpg)
All slides are licensed CC BY-NC-SA 3.0
3 Elasticsearch Servers
192 GB Ram, 8 cores * 2
![Page 21: Oded Coster - Stack Overflow behind the scenes - how it's made - Codemotion Milan 2017](https://reader033.vdocuments.net/reader033/viewer/2022051710/5a6479c67f8b9a40568b47bf/html5/thumbnails/21.jpg)
All slides are licensed CC BY-NC-SA 3.0
4 HAProxy Load Balancers
192 GB Ram, 4 cores * 2 (2)
64GB Ram, 4 cores * 2 (2)
![Page 22: Oded Coster - Stack Overflow behind the scenes - how it's made - Codemotion Milan 2017](https://reader033.vdocuments.net/reader033/viewer/2022051710/5a6479c67f8b9a40568b47bf/html5/thumbnails/22.jpg)
All slides are licensed CC BY-NC-SA 3.0
2 Networks
(switches + fabric extenders)
Cisco Nexus 5596UP (sw)Cisco Nexus 2232TM (fex)
![Page 23: Oded Coster - Stack Overflow behind the scenes - how it's made - Codemotion Milan 2017](https://reader033.vdocuments.net/reader033/viewer/2022051710/5a6479c67f8b9a40568b47bf/html5/thumbnails/23.jpg)
All slides are licensed CC BY-NC-SA 3.0
2 Firewalls
Fortinet 800C
![Page 24: Oded Coster - Stack Overflow behind the scenes - how it's made - Codemotion Milan 2017](https://reader033.vdocuments.net/reader033/viewer/2022051710/5a6479c67f8b9a40568b47bf/html5/thumbnails/24.jpg)
All slides are licensed CC BY-NC-SA 3.0
4 Routers
Cisco ASR-1001Cisco ASR-1001-x
![Page 25: Oded Coster - Stack Overflow behind the scenes - how it's made - Codemotion Milan 2017](https://reader033.vdocuments.net/reader033/viewer/2022051710/5a6479c67f8b9a40568b47bf/html5/thumbnails/25.jpg)
All slides are licensed CC BY-NC-SA 3.0
The NumbersServer side render times
![Page 26: Oded Coster - Stack Overflow behind the scenes - how it's made - Codemotion Milan 2017](https://reader033.vdocuments.net/reader033/viewer/2022051710/5a6479c67f8b9a40568b47bf/html5/thumbnails/26.jpg)
All slides are licensed CC BY-NC-SA 3.0
18.3 ms(on average)
To Render a Question Page
![Page 27: Oded Coster - Stack Overflow behind the scenes - how it's made - Codemotion Milan 2017](https://reader033.vdocuments.net/reader033/viewer/2022051710/5a6479c67f8b9a40568b47bf/html5/thumbnails/27.jpg)
All slides are licensed CC BY-NC-SA 3.0
12.2 ms(on average)
To Render the Home Page
![Page 28: Oded Coster - Stack Overflow behind the scenes - how it's made - Codemotion Milan 2017](https://reader033.vdocuments.net/reader033/viewer/2022051710/5a6479c67f8b9a40568b47bf/html5/thumbnails/28.jpg)
All slides are licensed CC BY-NC-SA 3.0
How it is doneTeamwork
![Page 29: Oded Coster - Stack Overflow behind the scenes - how it's made - Codemotion Milan 2017](https://reader033.vdocuments.net/reader033/viewer/2022051710/5a6479c67f8b9a40568b47bf/html5/thumbnails/29.jpg)
All slides are licensed CC BY-NC-SA 3.0
Globally DistributedStack Overflow has people all over the world:
- SE Asia: Japan, Australia
- Across Europe (Russia, France, Slovenia, Germany, UK and more)
- Across the US (New York, Colorado, Hawaii, North Carolina and more)
- Around 250 people
![Page 30: Oded Coster - Stack Overflow behind the scenes - how it's made - Codemotion Milan 2017](https://reader033.vdocuments.net/reader033/viewer/2022051710/5a6479c67f8b9a40568b47bf/html5/thumbnails/30.jpg)
All slides are licensed CC BY-NC-SA 3.0
Project Teams• Multi-discipline teams – developers, designers, product manager,
marketing, sales.
• Small teams – 5-10 people in each
• Focused on specific areas – Talent, Q&A Profiles, DAG, Jobs etc…
![Page 31: Oded Coster - Stack Overflow behind the scenes - how it's made - Codemotion Milan 2017](https://reader033.vdocuments.net/reader033/viewer/2022051710/5a6479c67f8b9a40568b47bf/html5/thumbnails/31.jpg)
All slides are licensed CC BY-NC-SA 3.0
Online CommunicationSync:
• Stack Chat / Slack (team preference)
• Google Hangouts
• Zoom (for larger groups/presentations)
Video is recorded and uploaded to YouTube channel.
![Page 32: Oded Coster - Stack Overflow behind the scenes - how it's made - Codemotion Milan 2017](https://reader033.vdocuments.net/reader033/viewer/2022051710/5a6479c67f8b9a40568b47bf/html5/thumbnails/32.jpg)
All slides are licensed CC BY-NC-SA 3.0
Online CommunicationAsync:
• Google Docs - specs, RFCs…
• Trello – project work, organising
• YouTube - keynotes, fireside chat
Point: have a record that people can refer to wherever and whenever they are
![Page 33: Oded Coster - Stack Overflow behind the scenes - how it's made - Codemotion Milan 2017](https://reader033.vdocuments.net/reader033/viewer/2022051710/5a6479c67f8b9a40568b47bf/html5/thumbnails/33.jpg)
All slides are licensed CC BY-NC-SA 3.0
Chat BotsSay when CI builds happen and what’s in them:
Who built to production and when:
![Page 34: Oded Coster - Stack Overflow behind the scenes - how it's made - Codemotion Milan 2017](https://reader033.vdocuments.net/reader033/viewer/2022051710/5a6479c67f8b9a40568b47bf/html5/thumbnails/34.jpg)
All slides are licensed CC BY-NC-SA 3.0
Chat BotsSome specific exceptions:
Unusual exception volumes:
![Page 35: Oded Coster - Stack Overflow behind the scenes - how it's made - Codemotion Milan 2017](https://reader033.vdocuments.net/reader033/viewer/2022051710/5a6479c67f8b9a40568b47bf/html5/thumbnails/35.jpg)
All slides are licensed CC BY-NC-SA 3.0
Chat BotsAnd a bit of fun…
![Page 36: Oded Coster - Stack Overflow behind the scenes - how it's made - Codemotion Milan 2017](https://reader033.vdocuments.net/reader033/viewer/2022051710/5a6479c67f8b9a40568b47bf/html5/thumbnails/36.jpg)
All slides are licensed CC BY-NC-SA 3.0
Chat BotsAnd a bit of fun…
![Page 37: Oded Coster - Stack Overflow behind the scenes - how it's made - Codemotion Milan 2017](https://reader033.vdocuments.net/reader033/viewer/2022051710/5a6479c67f8b9a40568b47bf/html5/thumbnails/37.jpg)
All slides are licensed CC BY-NC-SA 3.0
Chat BotsAnd a bit of fun…
![Page 38: Oded Coster - Stack Overflow behind the scenes - how it's made - Codemotion Milan 2017](https://reader033.vdocuments.net/reader033/viewer/2022051710/5a6479c67f8b9a40568b47bf/html5/thumbnails/38.jpg)
All slides are licensed CC BY-NC-SA 3.0
Chat BotsAnd a bit of fun…
![Page 39: Oded Coster - Stack Overflow behind the scenes - how it's made - Codemotion Milan 2017](https://reader033.vdocuments.net/reader033/viewer/2022051710/5a6479c67f8b9a40568b47bf/html5/thumbnails/39.jpg)
All slides are licensed CC BY-NC-SA 3.0
How it is doneWeb framework
![Page 40: Oded Coster - Stack Overflow behind the scenes - how it's made - Codemotion Milan 2017](https://reader033.vdocuments.net/reader033/viewer/2022051710/5a6479c67f8b9a40568b47bf/html5/thumbnails/40.jpg)
All slides are licensed CC BY-NC-SA 3.0
Core Stack
• C#
• LESS CSS
• TypeScript JavaScript
• ASP.NET/MVC
• IIS
• SQL Server – T-SQL
![Page 41: Oded Coster - Stack Overflow behind the scenes - how it's made - Codemotion Milan 2017](https://reader033.vdocuments.net/reader033/viewer/2022051710/5a6479c67f8b9a40568b47bf/html5/thumbnails/41.jpg)
All slides are licensed CC BY-NC-SA 3.0
Supporting Cast
• HAProxy - on CentOS
• Redis - on CentOS
• Elasticsearch - on CentOS
• Tag Engine - on Windows
![Page 42: Oded Coster - Stack Overflow behind the scenes - how it's made - Codemotion Milan 2017](https://reader033.vdocuments.net/reader033/viewer/2022051710/5a6479c67f8b9a40568b47bf/html5/thumbnails/42.jpg)
All slides are licensed CC BY-NC-SA 3.0
Technology Agnostic
Stack Overflow uses what makes sense and in a way it makes sense to use.
HAProxy on windows? Doesn’t make sense
Tag Engine on Linux? Doesn’t make sense (yet!)
![Page 43: Oded Coster - Stack Overflow behind the scenes - how it's made - Codemotion Milan 2017](https://reader033.vdocuments.net/reader033/viewer/2022051710/5a6479c67f8b9a40568b47bf/html5/thumbnails/43.jpg)
All slides are licensed CC BY-NC-SA 3.0
Tools
• Visual Studio
• Git
• GitLab
• TeamCity
• SSMS
![Page 44: Oded Coster - Stack Overflow behind the scenes - how it's made - Codemotion Milan 2017](https://reader033.vdocuments.net/reader033/viewer/2022051710/5a6479c67f8b9a40568b47bf/html5/thumbnails/44.jpg)
All slides are licensed CC BY-NC-SA 3.0
Development Process
• Local environments for developers• IIS, SQL Server, Redis, Elasticsearch, socket server• devlocalsetup – powershell scripts to install pretty much
the whole stack, as needed
• Mostly work off master• For complex work and reviews – PRs
• Not much in tests• Depends on team
![Page 45: Oded Coster - Stack Overflow behind the scenes - how it's made - Codemotion Milan 2017](https://reader033.vdocuments.net/reader033/viewer/2022051710/5a6479c67f8b9a40568b47bf/html5/thumbnails/45.jpg)
All slides are licensed CC BY-NC-SA 3.0
Promotion to Production
• Can by done by any developer at any time – one click deploy
• CI build to dev on push to origin
• Meta build – “staging”
• Prod build
• Watch logs and metas
![Page 46: Oded Coster - Stack Overflow behind the scenes - how it's made - Codemotion Milan 2017](https://reader033.vdocuments.net/reader033/viewer/2022051710/5a6479c67f8b9a40568b47bf/html5/thumbnails/46.jpg)
All slides are licensed CC BY-NC-SA 3.0
What the Build does
• Localization (JavaScript, C#, Razor views)
• LESS compilation + minification
• JavaScript bundling + minification• TypeScript transpiles are during dev
• Configuration transforms
• SQL migrations – in house tool
• Rolling build – 100% uptime
![Page 47: Oded Coster - Stack Overflow behind the scenes - how it's made - Codemotion Milan 2017](https://reader033.vdocuments.net/reader033/viewer/2022051710/5a6479c67f8b9a40568b47bf/html5/thumbnails/47.jpg)
All slides are licensed CC BY-NC-SA 3.0
How it is donePerformance
![Page 48: Oded Coster - Stack Overflow behind the scenes - how it's made - Codemotion Milan 2017](https://reader033.vdocuments.net/reader033/viewer/2022051710/5a6479c67f8b9a40568b47bf/html5/thumbnails/48.jpg)
All slides are licensed CC BY-NC-SA 3.0
Monitoring and AlertingMini Profiler
![Page 49: Oded Coster - Stack Overflow behind the scenes - how it's made - Codemotion Milan 2017](https://reader033.vdocuments.net/reader033/viewer/2022051710/5a6479c67f8b9a40568b47bf/html5/thumbnails/49.jpg)
All slides are licensed CC BY-NC-SA 3.0
Monitoring and Alerting
![Page 50: Oded Coster - Stack Overflow behind the scenes - how it's made - Codemotion Milan 2017](https://reader033.vdocuments.net/reader033/viewer/2022051710/5a6479c67f8b9a40568b47bf/html5/thumbnails/50.jpg)
All slides are licensed CC BY-NC-SA 3.0
Monitoring and Alerting
![Page 51: Oded Coster - Stack Overflow behind the scenes - how it's made - Codemotion Milan 2017](https://reader033.vdocuments.net/reader033/viewer/2022051710/5a6479c67f8b9a40568b47bf/html5/thumbnails/51.jpg)
All slides are licensed CC BY-NC-SA 3.0
Monitoring and Alerting
![Page 52: Oded Coster - Stack Overflow behind the scenes - how it's made - Codemotion Milan 2017](https://reader033.vdocuments.net/reader033/viewer/2022051710/5a6479c67f8b9a40568b47bf/html5/thumbnails/52.jpg)
All slides are licensed CC BY-NC-SA 3.0
Monitoring and AlertingOpeserver – dashboard and more
![Page 53: Oded Coster - Stack Overflow behind the scenes - how it's made - Codemotion Milan 2017](https://reader033.vdocuments.net/reader033/viewer/2022051710/5a6479c67f8b9a40568b47bf/html5/thumbnails/53.jpg)
All slides are licensed CC BY-NC-SA 3.0
Monitoring and AlertingWeb servers
![Page 54: Oded Coster - Stack Overflow behind the scenes - how it's made - Codemotion Milan 2017](https://reader033.vdocuments.net/reader033/viewer/2022051710/5a6479c67f8b9a40568b47bf/html5/thumbnails/54.jpg)
All slides are licensed CC BY-NC-SA 3.0
Monitoring and AlertingSQL servers
![Page 55: Oded Coster - Stack Overflow behind the scenes - how it's made - Codemotion Milan 2017](https://reader033.vdocuments.net/reader033/viewer/2022051710/5a6479c67f8b9a40568b47bf/html5/thumbnails/55.jpg)
All slides are licensed CC BY-NC-SA 3.0
Monitoring and AlertingSQL server – drill in
![Page 56: Oded Coster - Stack Overflow behind the scenes - how it's made - Codemotion Milan 2017](https://reader033.vdocuments.net/reader033/viewer/2022051710/5a6479c67f8b9a40568b47bf/html5/thumbnails/56.jpg)
All slides are licensed CC BY-NC-SA 3.0
Monitoring and AlertingSQL server – top queries
![Page 57: Oded Coster - Stack Overflow behind the scenes - how it's made - Codemotion Milan 2017](https://reader033.vdocuments.net/reader033/viewer/2022051710/5a6479c67f8b9a40568b47bf/html5/thumbnails/57.jpg)
All slides are licensed CC BY-NC-SA 3.0
Monitoring and AlertingExceptions
![Page 58: Oded Coster - Stack Overflow behind the scenes - how it's made - Codemotion Milan 2017](https://reader033.vdocuments.net/reader033/viewer/2022051710/5a6479c67f8b9a40568b47bf/html5/thumbnails/58.jpg)
All slides are licensed CC BY-NC-SA 3.0
Monitoring and AlertingExceptions
![Page 59: Oded Coster - Stack Overflow behind the scenes - how it's made - Codemotion Milan 2017](https://reader033.vdocuments.net/reader033/viewer/2022051710/5a6479c67f8b9a40568b47bf/html5/thumbnails/59.jpg)
All slides are licensed CC BY-NC-SA 3.0
Monitoring and AlertingRedis
![Page 60: Oded Coster - Stack Overflow behind the scenes - how it's made - Codemotion Milan 2017](https://reader033.vdocuments.net/reader033/viewer/2022051710/5a6479c67f8b9a40568b47bf/html5/thumbnails/60.jpg)
All slides are licensed CC BY-NC-SA 3.0
Monitoring and AlertingElasticsearch
![Page 61: Oded Coster - Stack Overflow behind the scenes - how it's made - Codemotion Milan 2017](https://reader033.vdocuments.net/reader033/viewer/2022051710/5a6479c67f8b9a40568b47bf/html5/thumbnails/61.jpg)
All slides are licensed CC BY-NC-SA 3.0
Monitoring and AlertingHAProxy
![Page 62: Oded Coster - Stack Overflow behind the scenes - how it's made - Codemotion Milan 2017](https://reader033.vdocuments.net/reader033/viewer/2022051710/5a6479c67f8b9a40568b47bf/html5/thumbnails/62.jpg)
All slides are licensed CC BY-NC-SA 3.0
Monitoring and AlertingGrafana – dashboards
![Page 63: Oded Coster - Stack Overflow behind the scenes - how it's made - Codemotion Milan 2017](https://reader033.vdocuments.net/reader033/viewer/2022051710/5a6479c67f8b9a40568b47bf/html5/thumbnails/63.jpg)
All slides are licensed CC BY-NC-SA 3.0
Monitoring and AlertingBosun
![Page 64: Oded Coster - Stack Overflow behind the scenes - how it's made - Codemotion Milan 2017](https://reader033.vdocuments.net/reader033/viewer/2022051710/5a6479c67f8b9a40568b47bf/html5/thumbnails/64.jpg)
All slides are licensed CC BY-NC-SA 3.0
Monitoring and AlertingBosun
![Page 65: Oded Coster - Stack Overflow behind the scenes - how it's made - Codemotion Milan 2017](https://reader033.vdocuments.net/reader033/viewer/2022051710/5a6479c67f8b9a40568b47bf/html5/thumbnails/65.jpg)
All slides are licensed CC BY-NC-SA 3.0
Monitoring and AlertingBosun
![Page 66: Oded Coster - Stack Overflow behind the scenes - how it's made - Codemotion Milan 2017](https://reader033.vdocuments.net/reader033/viewer/2022051710/5a6479c67f8b9a40568b47bf/html5/thumbnails/66.jpg)
All slides are licensed CC BY-NC-SA 3.0
Monitoring and Alerting
Mini profiler: github.com/MiniProfiler
Opserver: github.com/opserver/Opserver
Grafana: grafana.org
Bosun: bosun.org
Stack Overflow OSS: stackexchange.github.io
![Page 67: Oded Coster - Stack Overflow behind the scenes - how it's made - Codemotion Milan 2017](https://reader033.vdocuments.net/reader033/viewer/2022051710/5a6479c67f8b9a40568b47bf/html5/thumbnails/67.jpg)
All slides are licensed CC BY-NC-SA 3.0
Stack Overflow can run off one web server – that’s how much headroom they have.
This is a fact – it has happened, though not intentionally!
(bad deploy left only one web server operating)
![Page 68: Oded Coster - Stack Overflow behind the scenes - how it's made - Codemotion Milan 2017](https://reader033.vdocuments.net/reader033/viewer/2022051710/5a6479c67f8b9a40568b47bf/html5/thumbnails/68.jpg)
All slides are licensed CC BY-NC-SA 3.0
Optimization - Monitoring
All the monitoring mentioned previously is essential to their great performance.
You can’t optimize what you can’t measure.
![Page 69: Oded Coster - Stack Overflow behind the scenes - how it's made - Codemotion Milan 2017](https://reader033.vdocuments.net/reader033/viewer/2022051710/5a6479c67f8b9a40568b47bf/html5/thumbnails/69.jpg)
All slides are licensed CC BY-NC-SA 3.0
Optimization - SQL
Writing highly optimized SQL – everyone on the team goes through a SQL course where we learn how to read query plans and optimize written SQL.
Mini Profilers helps us find badly performing queries.
![Page 70: Oded Coster - Stack Overflow behind the scenes - how it's made - Codemotion Milan 2017](https://reader033.vdocuments.net/reader033/viewer/2022051710/5a6479c67f8b9a40568b47bf/html5/thumbnails/70.jpg)
All slides are licensed CC BY-NC-SA 3.0
Caching
Multiple levels of caching:
• L1 cache – on each web server
• L2 cache – Redis
Caches include results from the DB, HTML fragments and so on
![Page 71: Oded Coster - Stack Overflow behind the scenes - how it's made - Codemotion Milan 2017](https://reader033.vdocuments.net/reader033/viewer/2022051710/5a6479c67f8b9a40568b47bf/html5/thumbnails/71.jpg)
All slides are licensed CC BY-NC-SA 3.0
Fast libraries
When existing functionality is not fast enough and no 3rd party library is fast enough – we will sometimes write our own highly optimized / specific library.
Dapper – a micro ORM
Jil – a JSON serializer / deserializer
![Page 72: Oded Coster - Stack Overflow behind the scenes - how it's made - Codemotion Milan 2017](https://reader033.vdocuments.net/reader033/viewer/2022051710/5a6479c67f8b9a40568b47bf/html5/thumbnails/72.jpg)
All slides are licensed CC BY-NC-SA 3.0
Did I mention caching?
![Page 73: Oded Coster - Stack Overflow behind the scenes - how it's made - Codemotion Milan 2017](https://reader033.vdocuments.net/reader033/viewer/2022051710/5a6479c67f8b9a40568b47bf/html5/thumbnails/73.jpg)
All slides are licensed CC BY-NC-SA 3.0
Performance – misc
• Performance is important to them – performance is a feature
• Everyone on the team understands the low level of performance
• Understanding when to offload work – for example tag engine
![Page 74: Oded Coster - Stack Overflow behind the scenes - how it's made - Codemotion Milan 2017](https://reader033.vdocuments.net/reader033/viewer/2022051710/5a6479c67f8b9a40568b47bf/html5/thumbnails/74.jpg)
All slides are licensed CC BY-NC-SA 3.0
How it is done“The Cloud”
![Page 75: Oded Coster - Stack Overflow behind the scenes - how it's made - Codemotion Milan 2017](https://reader033.vdocuments.net/reader033/viewer/2022051710/5a6479c67f8b9a40568b47bf/html5/thumbnails/75.jpg)
All slides are licensed CC BY-NC-SA 3.0
Cloud Philosophy
• More expensive than co-located servers
• Unfit for their requirements:• Extreme high performance• Tight control of above
• Likely require re-engineering the DB (Stack Overflow DB larger than largest Azure offering)
![Page 76: Oded Coster - Stack Overflow behind the scenes - how it's made - Codemotion Milan 2017](https://reader033.vdocuments.net/reader033/viewer/2022051710/5a6479c67f8b9a40568b47bf/html5/thumbnails/76.jpg)
All slides are licensed CC BY-NC-SA 3.0
Cloud Philosophy - continued
• Doesn’t afford as much capacity headroom
• Unreliable internal network (slow, jittery)
• Latency issues
• Used for:• Backups (glacier)• DNS
![Page 77: Oded Coster - Stack Overflow behind the scenes - how it's made - Codemotion Milan 2017](https://reader033.vdocuments.net/reader033/viewer/2022051710/5a6479c67f8b9a40568b47bf/html5/thumbnails/77.jpg)
All slides are licensed CC BY-NC-SA 3.0
Thank you!Questions?
Oded Coster - @OdedCoster