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…
My £4 a month server can handle 4.2M requests a day
321–330 of 479 posts
Re: My £4 a month server can handle 4.2M requests a day
#322Earlier 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.
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.
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 actually break the law - because you found a loophole (made a loophole? hustled it? again, I'm impressed). You ran a gambling site from IoM though :-)
Re: My £4 a month server can handle 4.2M requests a day
#323Earlier quoted context omitted.
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…
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…
SqlAlchemy has this as part of the ORM, it should really be part of Django IMO.
Re: My £4 a month server can handle 4.2M requests a day
#324When 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
#325Earlier quoted context omitted.
Thanks. Yeah, I think I used that years ago when I first ran into this problem, and it worked well. Whether one uses an ORM or not, one needs to know how to use one's tools. My problem (not just with Django, but with ORMs in general) is how they make bad code look good. Like the following (I don't know Django well anymore, but something like this): users = User.objects.all() for u in user: print(u.name, len(u.comment…
users = User.objects.all() for u in user: print(u.name, len(u.comments)) This is fine if you are working with a small data set. It is inefficient, but if it's quick enough, readability trumps efficiency IMHO. Django ORM has a succinct way of doing the "SELECT COUNT(*)" pattern: users = User.objects.all() for u in user: print(u.name, u.comments.count()) And you can use query annotations to get rid of the N+1 query iss…
And this is how you end up with the problems the parent is describing. During testing and when you setup the system you always have a small dataset so it appears to work fine. But when it’s real work the system collapses.
Re: My £4 a month server can handle 4.2M requests a day
#326Re: My £4 a month server can handle 4.2M requests a day
#327Earlier 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.
Morally dubious? For sure.
Re: My £4 a month server can handle 4.2M requests a day
#328Earlier quoted context omitted.
Abstractions almost always end up leaky. Spark SQL, for example, does whole-stage codegen which collapses multiple project/filter stages into a single compiled stage, but your underlying data format still needs to be memory friendly (i.e. linear accesses, low branching, etc.). The codegen is very naive and the JVM JIT can only do so much. What I've seen is that you need people who deeply understand the system (e.g. S…
What's wrong with relying on data engineers for data engineering?
That being said, Spark is literally the only (relatively) easy way to run distributed ML that's open source. The competitors are GPU's (if you have a GPU friendly problem) and running multiple Python processes across the network.
(I'm really hoping that people will now school me, and I'll discover a much better way in the comments).
Re: My £4 a month server can handle 4.2M requests a day
#329People 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…
Re: My £4 a month server can handle 4.2M requests a day
#330Earlier 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.
Simply moving my USB mouse consumes 10% of my CPU. Computers these days...