Live data from Hacker News

My £4 a month server can handle 4.2M requests a day

mark.mcnally.je

311–320 of 479 posts

Re: My £4 a month server can handle 4.2M requests a day

#311

Earlier quoted context omitted.

He's a frickin genius because he found ways to break the law with impunity for his own profit ? I'm surprised by HN sometimes.

You can respect the ingenunity if not the morality of it. His solution was a clever hack because he worked around the law without apparently breaking it directly - clever. That said gambling systems are specifically one class of software I refuse to work on.

[deleted]

Re: My £4 a month server can handle 4.2M requests a day

#312

Earlier quoted context omitted.

That particular example seems like something that's probably a lot cheaper than you'd initially think. The OS has to constantly take mouse input anyway to move the pointer and dispatch events to userspace. It also needs to record the current and new position of the mouse pointer to dispatch the events. Detecting whether the mouse is being "shaken" can be done with a ring buffer of mouse velocities over the last secon…

Why not use an exponential filter that only uses a single variable?

Please elaborate.

Re: My £4 a month server can handle 4.2M requests a day

#314
post #187

Earlier quoted context omitted.

Yeah, I see this a lot. I think it's especially easy to introduce this kind of "accidentally quadratic" behaviour using magical ORMs like Django's, where an innocent-looking attribute access like user.groups can trigger a database query ... access user.groups inside a loop and things get bad quickly. In the case of groups and permissions there's probably only a few of each, so fetching all of them is probably fine. B…

Django's prefetch_related mechanism essentially implements the pattern you describe here for you: https://docs.djangoproject.com/en/3.2/ref/models/querysets/#...

select_related and prefetch_related are absolutely essential when coding Django.

Re: My £4 a month server can handle 4.2M requests a day

#315

When I launched my former bitcoin casino in 2011 (it's gone, but it was a casino where all games, even roulette tables were multiplayer, on a platform built from scratch starting in '08), I handled all web requests through a server in Costa Rica that cost about $6/mo. Where I had a shell corporation for $250/year. Once the front end -- the bullet containing the entire casino code, about 250kb -- loaded, from Costa Ri…

Why go through IoM at all? Why not Costa Rica -> Switzerland, rather than Costa Rica -> IoM -> Switzerland?

Re: My £4 a month server can handle 4.2M requests a day

#316

Earlier quoted context omitted.

You're a fricking genius.

He's a frickin genius because he found ways to break the law with impunity for his own profit ? I'm surprised by HN sometimes.

"the law"?

There is no "The law", just a bunch of different jurisdictions with different laws. He didn't break Switzerland law. Does Switzerland's law not matter for some reason?

Re: My £4 a month server can handle 4.2M requests a day

#317

Earlier quoted context omitted.

What reminded me of this the other day is how MacOS will grow your cursor if you “shake” it to help you find it on a big screen. I was thinking about how they must have a routine that’s constantly taking mouse input, buffering history, and running some algorithm to determine when user input is a mouse “shake”. And how many features like this add up to eat up a nontrivial amount of resources.

That particular example seems like something that's probably a lot cheaper than you'd initially think. The OS has to constantly take mouse input anyway to move the pointer and dispatch events to userspace. It also needs to record the current and new position of the mouse pointer to dispatch the events. Detecting whether the mouse is being "shaken" can be done with a ring buffer of mouse velocities over the last secon…

If you shake the cursor up and down, it doesn't grow.

Looks like it's measuring something like number of direction changes in relation to distance traveled; ignoring the y axis completely.

Re: My £4 a month server can handle 4.2M requests a day

#318

My 1cpu 2gb ram server: - nginx - slack bot behind Django - OpenVPN - Minecraft server (20 players) - tunneling (reverse proxy for local dev)

You're running an 20 players mc server with that hardware? How? In my experience Minecraft-servers are insanely resource hungry, especially whilst generating new parts of the map or larger red stone contraptions. Back when I played around with hosting servers I used the "most optimized" mc-server fork called Tuinity - and even with that I had to allocate way more cpu and ram to the vms then u use. Would love to hear about your setup.

Re: My £4 a month server can handle 4.2M requests a day

#319

All these "X requests per unit time" posts are starting to make me want to break out some of my experimental code... I have some services that can process several million events per second. This includes: compressing the event batch, persisting to disk, validation of business logic, execution of all view updates (state tracked server-side), aggregation and distribution of client update events, etc. These implementati…

> The trick I have found is to establish a websocket with your clients, and then pipe all of their events down with DOM updates coming up the other way. These 2 streams are entirely decoupled by way of the ringbuffer and a novel update/event strategy.

Could you detail this, please? I don't get it. What is the flow?

1. Browser is sending events to web server via web socket, instantly as the event is occurring (?)

2. ? (what exactly does the server do?)

Re: My £4 a month server can handle 4.2M requests a day

#320
In contrast, the Australian 2016 National Census crashed and burned since the system could not cope with over 250 requests a second.

Parliamentary enquiry:(PDF) https://www.aph.gov.au/DocumentStore.ashx?id=0a7f6bd5-8716-4...

https://www.zdnet.com/article/census-2016-among-worst-it-deb...

https://www.theguardian.com/australia-news/2016/aug/10/compu...

Post reply on HN