Reddit Programming – Telegram
Reddit Programming
211 subscribers
1.22K photos
125K links
I will send you newest post from subreddit /r/programming
Download Telegram
DNS Resolution Delay: The Silent Killer That Blocks Your Threads
https://www.reddit.com/r/programming/comments/1ox0lkn/dns_resolution_delay_the_silent_killer_that/

<!-- SC_OFF -->The Blocking Problem Everyone Forgets Here’s the thing about DNS lookups that catches people off guard. When your service needs to connect to another service, it has to resolve the hostname to an IP address. In most programming languages, this happens through a synchronous system call like getaddrinfo(). That means the thread making the request just sits there, doing nothing, waiting for the DNS response. Normally this takes 2-5 milliseconds and nobody notices. You have a thread pool of 200 threads, each request takes maybe 50ms total, and you’re processing thousands of requests per second without breaking a sweat. The occasional DNS lookup is just noise in the overall request time. But when DNS gets slow, everything changes. Imagine your DNS resolver is now taking 300ms to respond. Every thread that needs to establish a new connection is now blocked for 300ms just waiting for DNS. During that time, incoming requests pile up in the queue. More threads pick up queued requests, and they also need new connections, so they also get stuck on DNS. Before you know it, your entire thread pool is blocked waiting for DNS responses, and your service is effectively dead even though your CPU is at 15% and you have plenty of memory. https://howtech.substack.com/p/dns-resolution-delay-the-silent-killer https://github.com/sysdr/howtech/tree/main/dns_resolution <!-- SC_ON --> submitted by /u/Designer_Bug9592 (https://www.reddit.com/user/Designer_Bug9592)
[link] (https://howtech.substack.com/p/dns-resolution-delay-the-silent-killer) [comments] (https://www.reddit.com/r/programming/comments/1ox0lkn/dns_resolution_delay_the_silent_killer_that/)
Markdown files not openable because of GitHub Copilot · Issue #277450 · microsoft/vscode
https://www.reddit.com/r/programming/comments/1oxuk2c/markdown_files_not_openable_because_of_github/

<!-- SC_OFF -->You must click on the Copilot status bar, then click either "Set up Copilot" or "Skip for now". Disable GitHub Copilot/reload/ Reload with extensions disabled won't help. <!-- SC_ON --> submitted by /u/lactranandev (https://www.reddit.com/user/lactranandev)
[link] (https://github.com/microsoft/vscode/issues/277450) [comments] (https://www.reddit.com/r/programming/comments/1oxuk2c/markdown_files_not_openable_because_of_github/)
Refactoring Legacy: Part 1 - DTO's & Value Objects
https://www.reddit.com/r/programming/comments/1oy1ces/refactoring_legacy_part_1_dtos_value_objects/

<!-- SC_OFF -->Wrote about refactoring legacy systems using real-world examples: some patterns that actually help, some that really don’t and a cameo from Mr Bean’s car. Also: why empathy > clever code. Code examples are in PHP (yes, I know…), but the lessons are universal. <!-- SC_ON --> submitted by /u/clegginab0x (https://www.reddit.com/user/clegginab0x)
[link] (https://clegginabox.co.uk/refactoring-legacy-part-1-dtos-value-objects/) [comments] (https://www.reddit.com/r/programming/comments/1oy1ces/refactoring_legacy_part_1_dtos_value_objects/)