6 ms·
Handling 1M Requests per Minute with Go (2015)
- deleted 9y ago[deleted]
- qaq 9y agoSince when did per minute become a thing? 16K/sec is typical for a node app on fairly avg server.
- segmondy 9y agoA million sounds nice.
- GordonS 9y agoYes, but 'per minute' not so much. It really is rather odd to express perf figures like this
- kasey_junk 9y agoIt’s not a thing and it’s fairly trivial to get to that load on a typical go app as well.
- qaq 9y agoI am sure Go can do at the very least 2x-3x vs node for the same workload.
- gazarullz 9y agoSince you are sure, do you have any examples or proof to back that ?
- qaq 9y agoA random result from Google http://blog.digg.com/post/141552444676/making-the-switch-from-nodejs-to-golang http://blog.digg.com/post/141552444676/making-the-switch-fro.... My day job is writing large scale node services that service over million concur. clients doing fairly intensive data acquisition/processing so I am not hating on Node :)
- gazarullz 9y agoDon't get me wrong, I don't intend to mock your statement in any way but a statement backed by some data and/or actual examples adds a lot of credibility to it.
- rainbowmverse 9y agoI think Golang benefits from two related things: 1: There's basically one way to do anything, even if you pull in a library that collects those one ways to do another thing. 2: Those one ways are each developed by some of the most skilled engineers in the world and documented by someone with amazing clarity. (https://golang.org/pkg/ https://golang.org/pkg/) I have always had a lot of trouble trying to learn to program (used to struggle more with focus and memory), but Golang is just easy. I can look at an API I wrote as a learning project after 6 months of not writing any code and understand it perfectly. Node was not so bad when things worked, but I hit the same brick wall I did with [insert language] when something didn't go like the guide said it should.
- Thaxll 9y agoSince Node is single threaded how do you make that scale on multi core without something that spawn multiple Node app and thus using 2x 3x 4x the memory ...?
- qaq 9y agoIt's obviously application specific in our case data is written to Kafka and a bunch of workers are reading it off and do processing
- KirinDave 9y agoIt depends on the workload. CPU bound? For sure. Fake CPU bound (as this one is, spending tons of time in go's concurrency machinery), clearly not. I/O bound? I would have said no before Spectre and Meltdown ruined all our intuitions about performance. It's just a mess right now.
- te_chris 9y agoNew Relic
- KirinDave 9y ago16k r/s is not trivial to get for a non-hello-world app on NodeJS even on a big server, but if you read the article you'd see it's actually about a quarter of that. ... Yeah basically it is an article about using concurrency.
- qaq 9y agoI was not obviously commenting on the content but on a trend of coming up with measurements that make for a catchy title.
- KirinDave 9y ago> 16K/sec is typical for a node app on fairly avg server. This certainly doesn't read like "I'm talking about the title" to me. Also, in other parts of the thread you take performance questions seriously, further diluting the impression your post was about the title or phrasing.
- qaq 9y agoThe title is presenting handling 16K/sec as something special my only original point was that the author is using per minute metrics to make numbers look more impressive. It's very possible that I did a very poor job of making that point :). My comment that I am sure Go more performant than node was beign downvoted so that took things in a diff. direction.
- fastest963 9y agoWhy didn't he keep the first single-channel solution and just listen on the channel from multiple go routines? I don't see the advantage that a tiered approach gets you over that.
- ohnoesjmr 9y agoYeah, I fail to understand the purpose of the dispatcher thingy aswell. This also can run out of memory as he keeps spawning routines indefinately with each request in the dispatcher.
- mbrumlow 9y agoSeems like they just had a misunderstanding of how range worked. And now they have complicated code.
- baconomatic 9y agoWhat was the misunderstanding? I'm a Go noob and curious of what they did incorrectly. Edit: I read the comments at the end of the article and my question was answered.
- nwhatt 9y agoI appreciate thoughtful posts like this. Instead of the typical "Go is just better" style of article with specious data, this one talks about pitfalls around Go. All developers need to realize that there are tradeoffs with any implementation and this blog does a great job illustrating that.
- tuananh 9y agowhen i read it "blah blah with Go", i know for sure people is going to discuss about Node =))
- meritt 9y agoThey're uploading each POST payload to S3 at a rate of up to 1M uploads a minute? They're going to go broke from S3 operational fees. PUT fees are $0.005 per 1k, or $5/minute, or $7200/day S3 is an absolutely terrible financial choice for systems that need to store a vast number of tiny files.
- dx034 9y agoStoring millions of tiny files in any filesystem is a terrible choice.
- meritt 9y agoFair point, I was mostly focused on the absurd cost for that specific implementation. What would you suggest as an alternative? A document-oriented database?
- timClicks 9y agoAn underused option is actually SQLite. That gives you a surprisingly feature-rich system with very low overhead. In fact, you may see benefits: faster access and less disk usage https://www.sqlite.org/fasterthanfs.html https://www.sqlite.org/fasterthanfs.html A key-value store would probably work well, depending on how well its storage layer is architected.
- natbobc 9y agoIf you're on AWS I would probably go with DynamoDB, if you're on GCP Datastore. They aren't drop-in replacements for one another but the way you architect your system will be similar(ish). The main benefit is that it'll cost less upfront and require less to manage. Now that AWS have simplified back-ups it's a pretty simple system to operate. If you're looking for better controls over latency then I'd probably go with Cassandra. There's a big caveat to any NoSQL database and that's how you handle aggregates/roll-ups. With a standard database it's easy to write these queries. If you do it without thinking on a NoSQL system it'll cost you in performance and where billed per access, money. There's a few ways to address this; - batch ala map-reduce. - streaming ala Apache Beam, Spark, etc. - in query counting (aka sharded counters).
- 35bge57dtjku 9y agoIt's strange that they seem to think this is an amazing amount of scaling and then go on to reveal that it's actually with 20 servers. And it's not like their solution is novel.
- phillipcarter 9y ago833 requests per second per server (though it's not likely that the load is perfectly distributed like that). I'm ... not very impressed.
- deleted 9y ago[deleted]
- teh_klev 9y agoWell actually... :) If you read to the end: "After we had properly configured our cluster and the auto-scaling settings, we were able to lower it even more to only 4x EC2 c4.Large instances and the Elastic Auto-Scaling set to spawn a new instance if CPU goes above 90% for 5 minutes straight." From last time's discussion on this (https://news.ycombinator.com/item?id=9845820 https://news.ycombinator.com/item?id=9845820): This comment is kind of insightful: https://news.ycombinator.com/item?id=9846606 https://news.ycombinator.com/item?id=9846606 "I was confused by the numbers at first, so: that's 17k requests per second, spread out over 4 dual core Xeon (Haswell) machines, which works out to just over 4000 requests/s per machine. It's still a respectable number, but it's much closer to what one would expect given the task." "Don't get me wrong, the most interesting part is definitely the implementation and as a Go noob I found it very useful - it's just a bit misleading for the headline to sum your request rate across all parallelized machines."
- kureikain 9y agoLast year I wrote a Go service handle JSON posting with payload of ~ 100KB and insert them into MongoDB. It requires trivial amount of work and on a single t2.small server it can handle up to 200K RPM just fine. So this number 1M request on 4x c4.Large mean 250K RPM on a single c4.large. Maybe their payload is too big and writing data to S3 is probably slower than to a MongoDB cluster. I was so happy at Go performance and since that day I realize just how slow other language is. I found Java is quite comparable to Go as well. I was coming from Ruby/PHP and I didn't realize how fast other languages are until I tried it.