Live data from Hacker News

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

mark.mcnally.je

341–350 of 479 posts

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

#341

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.

Is your assertion that, because you deem his actions immoral, they did not require intelligence?

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

#342

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…

> we didn't perform random calculations on their server, thus weren't a gambling site under IoM law.

Does it really matter if you get your random number from /dev/urandom or a server in Switzerland?

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

#343
post #90

People tend to severely underestimate how fast modern machines are and overestimate how much you need to spend on hardware. Back in my last startup, I was doing a crypto market intelligence website that subscribed to full trade & order book feeds from the top 10 exchanges. It handled about 3K incoming messages/second (~260M per day), including all of the message parsing, order book update, processing, streaming to we…

A lot of that is due to absolutely lousy code. We had a system management backend at my last company. Loading the users list was unbearably slow; 10+ seconds on a warm cache. Not too terrible, except that most user management tasks required a page reload, so it was just wildly infuriating. Eventually I took a look at the code for the page, which queried LDAP for user data and the database for permissions data. It did…

In defense of whoever wrote the original code: it probably would have been reasonably fast if it had been a database query with proper indexes. The filters would have whittled the selection down to only the relevant data, whereas returning basically three entire tables of data to then throw away most of it would have been extremely inefficient.

The mistake of course was not thinking about why this approach is faster in a database query and that it doesn't work that way when you already need to get all the data out of LDAP to do anything with it.

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

#344
post #338

Earlier quoted context omitted.

Uh, excuse me, but this whole story demonstrates that I went to extreme lengths to never break any laws , no matter how large or small the jurisdiction. Had I been willing to bend laws, I'd surely be a lot richer today.

Sure, you're not breaking any laws, just intentionally violating the spirit of the law for personal gain. This isn't a court of law. I can understand trying to avoid language that makes it sound like you may have been in violation of the law to a judge or jury, but you literally described that what you did was intended to keep operating a service that had been banned by using an absurd technicality in the definition…

I suspect your anger derives from the fact that this would not be possible to get away with now, in any way shape or form, only ten years later. And truly the world is way more locked down now than it was then when people were like, "Bitcoin? What's that? you want to pay me to write a legal brief?" so, yeah. I feel sorry for kids ten years younger than me.

When I did it, the only thing I was really afraid of was getting arrested if/when I stepped back on American soil. There was redundancy so I could run the whole thing in Costa Rica if I had to cold shutdown the IoM servers. And the coin was in private wallets, mostly on my laptop. But I was very concerned about breaking any laws, anywhere. I was the only one to implement ID verification and fully block American players.

Call it a hack or whatever, they wanted my business and I needed their servers, and I split up my code so it would be legal according to their laws. Not too different from what a lot of companies do.

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

#345

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.

No laws were broken, else they'd be in jail. It's how the big companies that HN worships get away with not paying taxes. Morally dubious? For sure.

> No laws were broken, else they'd be in jail.

Just because OP isn't in jail doesn't mean they didn't break the law. Laws are broken all the time.

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

#346

Earlier quoted context omitted.

Come on, cURL'ing to a foreign server to get a random number and not just reading /dev/urandom is logically identical. It's a hack, just like calling into GPL'ed code over HTTP is a hack to avoid "linking" the GPL'ed code. It doesn't really suddenly turn a site from gambling site into a non-gambling site. I mean, I have mad respect for the hustle with the former MP etc. I agree with what you say in that you did not a…

What's so funny is - I was in a peer group of early btc founders who were starting random Bitcoin hustles and didn't care at all about laws. No one at that time had even approached the IoM about whether BTC was currency - nor would they have, because trying to find legal haven was the furthest thing from their minds. And so not surprisingly, the IoM didn't have a ready answer when I asked them whether gambling with B…

Are you actually an LA taxi driver, like it says in your bio?

What a story.

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

#347

Earlier quoted context omitted.

It is not "our" protocol, it is protocol designed by exchange and we need to support it, as we can not change it :). Simple binary messages, with binary encoded numbers, etc. No string parsing, no syntax, nothing like this, only bytes and offsets. Think about TCP header, for example. JSON is very inefficient both in bytes (32 bit price is 4 bytes in binary and could be 7+ bytes as string, think "1299.99" for example)…

Curious if the binary protocol uses floating point or a fixed point representation? Or is floating point with its rounding issues sufficient for the protocol's needs?

No GP but familiar with these protocols. They use fixed point extensively; I can't even thing of an exchange protocol which would use floating point since the rounding issues would cause unnecessary and expensive problems.

This is typical (from NASDAQ http://www.nasdaqtrader.com/content/technicalsupport/specifi... ):

Prices are integer fields. When converted to a decimal format, prices are in fixed point format with 6 whole number places followed by 4 decimal digits. The maximum price in OUCH 4.2 is $199,999.9900 (decimal, 7735939C hex). When entering market orders for a cross, use the special price of $214,748.3647 (decimal, 7FFFFFFF hex).

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

#348
post #206

Earlier quoted context omitted.

The more I read comments on subjects I am intimately familiar with, the more I realize most people who comment on HN don't really know what they're talking about and mostly make things up. To answer your question, you can't find these servers because they don't exist. A server with 4T of RAM will cost you at a minimum $20,000 and that will be for some really crappy low-grade RAM. Realistically for an actual server th…

> The more I read comments on subjects I am intimately familiar with, the more I realize most people who comment on HN don't really know what they're talking about and mostly make things up. HN doesn't look exactly like SlashDot, but it's absolutely just like SlashDot.

It's mostly the good bits of old /. for me.

Intelligent discourse by knowledgeable persons.

The omission of GNAA and "frosty" posts are a massive boon.

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

#349

Earlier quoted context omitted.

Uh, excuse me, but this whole story demonstrates that I went to extreme lengths to never break any laws , no matter how large or small the jurisdiction. Had I been willing to bend laws, I'd surely be a lot richer today.

Come on, cURL'ing to a foreign server to get a random number and not just reading /dev/urandom is logically identical. It's a hack, just like calling into GPL'ed code over HTTP is a hack to avoid "linking" the GPL'ed code. It doesn't really suddenly turn a site from gambling site into a non-gambling site. I mean, I have mad respect for the hustle with the former MP etc. I agree with what you say in that you did not a…

> Come on, cURL'ing to a foreign server to get a random number and not just reading /dev/urandom is logically identical. It's a hack, just like calling into GPL'ed code over HTTP is a hack to avoid "linking" the GPL'ed code. It doesn't really suddenly turn a site from gambling site into a non-gambling site.

Around here (and probably elsewhere) bars aren't allowed to make wine stronger by adding spirit.

So if you mix a drink from wine (or similar) and spirit in that order you might lose your license.

Put the spirit in the glass first and all is ok.

I guess at this point it is just a shibboleth that inspectors use to see if the bar has read the rules at all, kind of like the no brown m&ms.

Point is though: rules matter, you can lose your license over it.

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

#350

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. ?…

You got 1 correct. Everything that happens gets sent immediately as an event to the server (e.g. KeyDownEvent). These are pushed without blocking for a response to each - The websocket guarantees delivery and ordering.

Upon receiving an event from the client socket, it is immediately inserted into the LMAX ring buffer for processing.

Updates to the client are triggered by events+state determining when a redraw is required and issuing a special "ClientRedraw" event into the same queue. These events are grouped by client so that we can aggregate multiple potential updates in a single actual redraw. These result in view updates being pushed back down to the relevant clients. One performance trick here is that the client redraw is dispatched asynchronously from the server, so there is no blocking on processing the subsequent batches each time.

You can think of an E2E client view update as always requiring 2 events - the client event that triggered the change to domain state, and the actual redraw event(s) that result. For applications where the client should update at a fixed interval (e.g. game), a high performance timer implementation injects periodic redraw events. Because the upper bound of the ring buffer latency is around a millisecond, this allows for incredibly low jitter on real time events. Scheduling client draws as simple domain events is feasible.

Post reply on HN