200 points · by jeswin · 4y ago · 223 comments
Also flightradar24 feels something that should benefit heavily from caching especially in an instance where lots of people are all tracking the same thing.
Heavier caching for non-logged in users is a basic of keeping sites up against unexpected influx because the vast majority of "new" (i.e. spikey) traffic won't have accounts, and won't be as fuzzy about seeing cached data, and are harder to monetize than logged in accounts.
Nancy Pelosi visiting Taiwan, which China is opposed to.
The House is similar to the UK Parliament. She is elected to her position by the members of the House.
Since Democracts control the House this term, they elected Nancy Pelosi as Speaker for this term.
The President has primary responsibility for foreign affairs. The Speaker taking this action could be interpretted as stepping on the toes of the President, or could have tacit approval of the President as a kind of stalking horse.
I've seen AF1 land at the airport here (Bozeman) -- it flew in to the area at high altitude then circled tightly reducing altitude until final approach. I assumed to reduce the chance of a stinger hit from mountain-men.
A military-level attack against the third highest representative of the United States is a quite certain way to launch a war, maybe even nuclear retaliation, based on how quickly and well "prove" for attribution is unveiled.
However getting attention is a key purpose of that trip.
[1] https://twitter.com/flightradar24/status/1554501909893062656
Edit: FR24 link for comparison: https://www.flightradar24.com/SPAR19/2ce4f83f
They heavily censor their feed. Not only for military aircraft, but they also have a service where you can pay to have your aircraft hidden by the system.
Personally my beef with them is that they started as a paid app, then transitioned to a subscription model and left everyone who bought the app hanging.
It's called "Estimations", and is in the Visibility tab of Settings. By default it will show up to 4 hours of estimated positions.
I can't say whether that's what was shown for this flight or not, as it won't show historical data for SPAR19.
Sounds like they needed a monolith, single server ;) (tongue in cheek, I know it's not that simple)
[1] https://thestack.technology/air-traffic-tracking-site-flight...
In fact loading their home page takes 3.1 MB for me over two minutes. Searching for a flight (AAL301 in this case since SPAR19 has already landed) brings this to 3.8 MB. At this size it would be 266 gigabytes, US$27. Reloading the page, I see that this was about 180 HTTP hits, though a lot of those were ads (I guess they have a way to monetize the traffic) which were blocked by uBlock Origin.
But doesn't it take a lot of CPU and RAM to serve 700_000 page views, especially at 180 hits per page view? That's 126 million hits, after all! Well, of course you can write your code arbitrarily inefficiently. According to https://crozdesk.com/software/fastly/pricing Fastly charges US$0.0075 per ten thousand hits, so if you could serve all those hits from Fastly it would cost you just under US$100. And probably if you're getting 700_000 people looking at the same thing you should figure out how to make all those hits cacheable either in Fastly or in something slower but cheaper. This probably isn't the first popular flight on FlightRadar24, even if it's the first one that's this popular.
(Also though you probably don't need 180 hits to serve up a single page. One for HTML, one for JS, one for CSS, one for an icon sprite sheet, and maybe half a dozen map tiles. The cause of death was a self-inflicted wound.)
What if we want to know the minimal CPU cost to serve up 126 million hits rather than the minimal dollar cost for someone else to serve them up for you? Well, one weekend a few years ago I wrote a static file HTTP web server called httpdito-386: http://canonical.org/~kragen/sw/dev3/server.s (docs in http://canonical.org/~kragen/sw/dev3/httpdito-readme). It's 710 lines of code and can handle 20_000-30_000 hits per second on my ten-year-old laptop (8 cores) and push about 1.8 gigabits per second of traffic. It's not the most efficient web server (it forks a new process for every connection and drops the connection after handling the first request) but it's probably adequate to get a ballpark figure.
Serving up 126 million hits with httpdito would take 84 minutes on my ten-year-old laptop, so probably you'd have needed 2-5 server machines, or one machine that wasn't ten years old. Serving up 70 gigabytes in a smaller number of hits would have taken 5 minutes.
Of course, the whole point of FlightRadar24 is that it's giving you dynamically updated Comet information about where flights are, not just serving up precomputed files from the filesystem. You could implement this kind of functionality by polling, but using Comet would probably be more efficient. Maintaining 700_000 open connections is easily within the capacity of a single server today; we were doing several thousand on our Comet server at KnowNow in 02000, using what we called RUTH (Robert's Ugly Thttpd Hack), using select() on a 32-bit machine with a gigabyte of RAM and a gigahertz.
https://news.ycombinator.com/item?id=32319147 says, "Use one big server." The associated article https://specbranch.com/posts/one-big-server/ profiles the servers they use at Azure: two 64-core CPUs with a 2-2.5 GHz clock, 4-6 instructions per clock, 256 MiB (MB?) of L3 cache, and 1 TiB (TB?) of RAM. From the cloud pricing they're citing, buying one probably costs about US$15k, roughly the cost of one programmer-week. According to https://news.ycombinator.com/item?id=32321406, FlightRadar24's revenue in 02021 was US$25M, so this would be a little less than 6 hours of their revenue.
There's no excuse.
Your walltext paints an incredibly incomplete picture of their overall hosting expenditure. They aren't running a wordpress site lol.
They don't need unlimited scaling for the entire site, just enough to scale for one particular plane.
They make money from ads and subscriptions. Any such business pays for user acquisition and a % of users convert to subscriptions.
Even if all this is spiky traffic, their site probably has now had millions of first-time users. When traffic dies down, they will settle back at a higher than previous usual levels.
Cloud infrastructure is expensive.
I’m sure it wasn’t intentional but this word in a high profile airline headline is a bit jarring.
It was impressively simple to keep running, and they easily scaled it to handle massive spikes related to sports events and such. The only real downside is the delay in new data hitting the UI layer, but this was built out while a lot of people still had webtrends installs kicking around, so it was perfectly acceptable for their customers.
This is more likely to be about not overflying China/PRC's disputed territorial claims in the South China Sea - the flight certainly has to overfly part of that claim (because it in includes Taiwan/ROC), but it doesn't have to fly over all of it ... seems like some kind of carefully calibrated diplomatic message / inside baseball.
https://www.yesterdaysairlines.com/airline-history-blog/shak...
Hrmmm
Not that it really matters, but I wonder which would actually bothers the PRC more. I would have thought that the real source of irritation with, "Republic of China," is that it references the name used by mainland China up until the revolution of 1949, thus manifesting Taiwan's historical claim to be the legitimate Chinese government in exile.