Hacker Newsnew | past | comments | ask | show | jobs | submitlogin
40 millisecond bug (vorner.github.io)
123 points by sshroot on Nov 18, 2020 | hide | past | favorite | 26 comments


> [...I] asked on Slack if that 40ms value was familiar to anyone. Nothing.

In the future, you should use this as an excuse to read more HN at work ;): https://news.ycombinator.com/item?id=24785405


Rachel's blog posts are brilliant for preparing for stuff like this. She's highlighted some great clues to look out for in the past, like seeing the constant 0x48545450 where it shouldn't be[1].

[1] https://rachelbythebay.com/w/2016/02/21/malloc/


Hm, in that post Rachel mentions that 1213486160 is going on her list of magic numbers... I wonder if this list has ever been made public anywhere? I'd very much like to see it...


1213486160 is just the decimal representation of 0x48545450.


Well, yes, that's explained in the post. I'm not asking where the number comes from, I'm asking if the longer list of "magic numbers" can be found anywhere.


this somewhat feeds my impostor syndrome. as a regular old software eng I never got into a position where I could be seeing things like this. am I not working on hard enough problems?? this eats at my soul.


I really wonder sometimes why not more devs read HN. At my previous company most of them wouldn't read HN, but twitter instead.


Sometimes I wonder why I read HN.

There's some good stuff, but there's also a lot of fluff and bad political takes.

It doesn't seem clearly better than Reddit's /r/programming board, just different and a little more eager to bury un-interesting posts. (but not controversial ones)

That said, I'm not aware of anyone at my company who reads Reddit other than me, either.


A lot of time ago I saw people here thinking in interesting ways about enterprises and side projects and said "hey, I want to learn that kind of thinking".

With that goal achieved, I think I stay out of boredom. (Like, at this exact moment, I have a script running at work that is blocking basically anything I can do, so I have 10 minutes.)


30% snarky:

I think majority of devs does not really care about west coast startup scene or generally VCs.

Also there may be better news aggregators when it comes to Linux or LLVM or Postgres or famous IT/Math people or dramas with computer stuff involved.


> Also there may be better news aggregators when it comes to Linux or LLVM or Postgres or famous IT/Math people

I would be grateful if someone can list some of them. (Maybe https://lobste.rs/ but I always forgot to look at it and I don't know anyone to invite me)


Perhaps I have not skimmed lobste.rs enough to make an accurate assessment ('cuz I don't know anyone to send me an invite, either), but lobster.rs just feels like a mirror of HN the times I looked.


Like, Software Engineering Twitter?

I personally find Twitter works best to deliver media content (not text), so I follow mostly artists.

SWE posts tend to require more context and explanation that will just immediately kick me off Twitter again.


I personally find Twitter works best to deliver steaming piles of bloaty javascript encrusted upon an occasional 140-character message.


yes, SWE Twitter!


Good content and comments get downvoted because of the hivemind, with some topics (linguistics, for example) taking it especially hard because, apparently, the hivemind doesn't like linguistics and downvotes content with accurate information on the subject.


I knew I'd read about this problem before!


40ms, Ctrl-F "Nagle" - "5 matches"

Yep, same rake, different person. Just another day in tech.


As soon as he mentioned a fixed 40ms delay, my first guess was some obscure TCP configuration.

TCP is one of those ubiquitous things everyone takes for granted, but is more complex than most people realize.


Yeah, I saw the 40ms and something pinged in my head. Couldn't think of it though, but there it was in the article, Nagle's. The other article linked here also mentioned it. The term even means something to me in my current day job, as there's a switch to toggle Nagle's Algorithm in our application's UI somewhere (renamed it from "No Delay")


> renamed it from "No Delay"

It's called that because to turn off Nagles for unix sockets you set sockopt TCP_NODELAY.

If you run curl in verbose mode you can see it does that at the beginning.


Same old bug, same old blog post repost: http://forwardscattering.org/post/3 "Sockets should have a flushHint() API call"


This can be accomplished with the TCP socket options TCP_CORK on Linux and TCP_NOPUSH on FreeBSD and OpenBSD. When enabled only full TCP frames are sent; upon disabling any partial frame is immediately sent. See tcp(7) on Linux, tcp(4) on FreeBSD, and http://dotat.at/writing/nopush.html clarifying the behavior.


Yeah, TCP_CORK would work but it's not an elegant solution IMO.


I'm not a network guy and even I know about nagle. Then again I read a lot.

So the author and a colleague didn't know - 2 people who worked on a networking utility and had to spend days digging into it. The cost of reading books is high but the ROI is higher. Maybe they got unlucky but being a dev needs considerable knowledge but companies want their full stack devs cheap.


/r/iamverysmart




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: