19 ms·
Old box, dumb code, few thousand connections, no big deal
- draw_down 7y ago> I get the impression that a lot of us (myself included) hit a certain point, get tired of this crap, and just want to be free of it. Preach it, sister!
- kccqzy 7y agoThe C10k problem was challenging around the turn of the century. I suppose it's now not. I wonder how much CPU would be saved using an event-based architecture.
- milesvp 7y agoEven in 2007 when I was starting to cut my teeth on larger web traffic there was a lot of discussion around serving 10k concurrent connections. I remember being blown away by a graph showing high throughput at 70k concurrent by a YAWS server, and started following Erlang as a result.
- aeyes 7y agoIn 2004 we had eDonkey servers handling 1M concurrent connections. Code, changelog and a bit of history: https://lugdunum.shortypower.org/kiten.html https://lugdunum.shortypower.org/kiten.html
- milesvp 7y agoOh, wow, I vaguely remember running across eDonkey at one point. I don't think I ever realized it could handle that kind of load. I was in a position to mostly stick with Apache for various non technical reason basically for long enough that eventually Apache got to the point that it could handle the traffic I needed to deal with especially with a CDN in front of it.
- dmix 7y agoC10k problem is now C10M, from wikipedia: > By the early 2010s millions of connections on a single commodity 1U server became possible: over 2 million connections (WhatsApp, 24 cores, using Erlang on FreeBSD), 10–12 million connections (MigratoryData, 12 cores, using Java on Linux). https://en.wikipedia.org/wiki/C10k_problem https://en.wikipedia.org/wiki/C10k_problem
- monocasa 7y agoYeah, the cutting edge is C10M now. C10K was solved by switching to an event system like epoll or kqueue. This decreased the big O complexity of kernel<->user information flow so that you don't pay more for listening on more sockets. C10M seems to be solved by colocating the network stack and app stack data structures by running the driver and the app in the same context. This can be achieved via DPDK-like schemes or pushing more into the kernel like Netflix's work to push TLS into kernel sockets that you can sendfile to.
- simfoo 7y agoHonest question: why go through the hassle of multiplexing waiting in a single thread only to dispatch to a thread per client anyway? Simply using blocking IO for the clients in those threads should be much simpler right?
- deleted 7y ago[deleted]
- probably_wrong 7y agoI think the answer is in the previous article about Python linked in this article: to show that you can serve more requests with less resources if you avoid the Python/Gunicorn way and do it her way instead.
- rachelbythebay 7y agoIf you get stuck in read(), you can't do neat things like waking up when it's time to kick a client for being idle, doing other housekeeping, or cleanly shutting down the whole thing in a timely fashion. When I ^C the server, it sends the same wake condvar-poke but it twiddles the flags so the worker shuts down instead.
- pdonis 7y agoYes, using epoll with nonblocking I/O is better than blocking I/O on each worker thread. But that basically means that you are doing asynchronous programming--i.e., the exact same thing that the wonky Python/Gunicorn stack you described is doing! You're just doing it with better attention to important details. Here, to me, is the key item: The "listener" thread owns all of the file descriptors (listeners and clients both), and manages a single epoll set to watch over them. This is exactly what any async server does: it centralizes all the file descriptor management and handling in one place, and only uses workers (whether they are threads or "green threads" or whatever) to read from/write to fd's that are marked as ready in the epoll set. For your case, unless I'm misreading something, what the workers are doing in between the read/write is CPU intensive (or at least it's CPU work and not I/O work, even though it's not very "intensive" CPU work), so actual OS threads are a better choice for the workers since you can't rely on cooperative scheduling. If what the workers were doing was I/O work (for example, sending a request to a remote database and waiting for a response), "green threads" would work fine (since their only real purpose would be to organize the I/O--the actual fd's are going to be managed by the central server that manages all the fd's and checks which ones are ready for read/write). And one definitely should not try to run "green threads" for the same server in multiple O/S threads (or worse still, multiple OS processes). For an I/O bound server, one shouldn't need to anyway.
- thenewwazoo 7y agoBut this isn’t engineering. This is the IT equivalent of building a bridge and driving successively larger trucks over it. In real engineering fields, you can do predictive analyses based on prior empiricism. There’s none of that in our fields until you’re talking about very small systems where, for example, the stack consumption can be determined in advance and the scheduler can give you guarantees about worst-case performance. And this is to the detriment of all of us. That’s why you’ll never hear me call myself an engineer.
- sjburt 7y agoIf “real engineering” worked the way you described, we would test planes by filling them full of passengers and flying them around the world. We don’t. We built wind tunnel models, we taxi them around at higher and higher speeds, we put them in machines that wiggle the wings at high loads. The first flight is a little hop and then right back down. Months later there might be a big ceremony with VIPs where the new plane takes a lap around the airport as it’s “first flight”. And there are mistakes song the way, giant ones that add years to the schedule and tiny ones that engineers argue over even telling their boss about. Sure there’s planning and experience, just like she knew to use epoll and not select, and that Linux can handle thousands of threads per process. But there’s no magic to it, just lots and lots of human attention and testing along the way.
- noir_lord 7y ago> If “real engineering” worked the way you described, we would test planes by filling them full of passengers and flying them around the world. Didn’t Boeing just get caught trying that?.
- acdha 7y agoThe problems were identified early on but the NTSB, FAA, and their own engineers were overruled by the business people: see e.g. https://www.nytimes.com/2019/10/02/business/boeing-737-max-crashes.html https://www.nytimes.com/2019/10/02/business/boeing-737-max-c...
- 7y ago
- jpitz 7y agoWould love to see the code.
- 205guy 7y agoFunny, when she revealed what the threads were doing, I wanted to search for Shakespeare in the output.
- blondin 7y agome too. said it has no real purpose yet. that's key. no doubt she knows what she is writing about and also picked a favorable language. but the gunicorn folks have also been doing this server thing forever now. they probably have their share of stories. hope some code gets released soon.
- bdcravens 7y ago"at least one stupid chat client that's actually a giant piggy web browser running" I wonder what app that could be :-)
- trianglem 7y agoI’ll bite, is it slack?
- haneefmubarak 7y agoIn all honesty, there's a whole slew of platforms it could be: - Slack - Keybase - Mattermost - Discord - Microsoft Teams - Facebook Messenger (incl. Work) All of these fine folks apparently use Electron or a similar technology...
- greggyb 7y agoOr it could be Rambox with all of those!
- tjalfi 7y agoCisco Jabber also embeds a browser engine. I think of Electron as Gresham's law in action.
- neurostimulant 7y agoDon't forget Whatsapp desktop
- ClikeX 7y agoIn my experience the Discord client has been pretty smooth in general. Slack on the other hand can be very slow at times.
- baryphonic 7y agoThe problem is there are so many stupid chat clients that are actually giant piggy web browsers. :-D
- ivalm 7y agoWhat WSGI do people recommend for python? I've been using gunicorn but this made me think of alternatives. Quick google search found this benchmark [0], is it really that bjoern is much quicker? It seems all other WSGI are ~ equivalent. [0] - https://www.appdynamics.com/blog/engineering/a-performance-analysis-of-python-wsgi-servers-part-2/ https://www.appdynamics.com/blog/engineering/a-performance-a...
- TheAdamAndChe 7y agoI've used uwsgi a few times before. It is a pain to set up every time, but once it's configured, it works fine for the small, basic apps that I make.
- dimatura 7y agoI've mainly used gunicorn and uwsgi, without seeing any large differences. But my apps have fairly light network requirements. It seems like the new trend for Python servers is ASGI (https://asgi.readthedocs.io/en/latest/ https://asgi.readthedocs.io/en/latest/), e.g. as in uvicorn (https://www.uvicorn.org/ https://www.uvicorn.org/).
- DizzyDoo 7y agoI'm using Waitress in production: https://docs.pylonsproject.org/projects/waitress/en/stable/ https://docs.pylonsproject.org/projects/waitress/en/stable/ It's main thing is that it's really simple, worth a look if you're using Django.
- 7y ago
- throwaway894345 7y agoUnfortunately this approach precludes GIL languages like Python. If you're able to use a language/runtime that is amenable to multithreading, then using a thread per connection works fine for most use cases (and it's probably easier than using whatever async/await interface your language has).
- th0ma5 7y agoTrue that the GIL prevents the specific expressed pattern you're talking about, but many have been able to do multiple threads and processes with Python itself and also things like gunicorn or uwsgi.
- throwaway894345 7y agoYes, but I was responding to the article which was describing alternative patterns besides wsgi.
- pmoleri 7y ago> probably easier than using whatever async/await interface your language has Is it? I haven't used threads directly in a while, but I remember dealing with sinchronization issues. Problems that just don't exist in single threaded node with async await. I find the async Promise or Task to be a more useful abstraction than the thread. Although, you need threads or a task dispatcher with a pool of threads if you need to run cpu intensive stuff.
- throwaway894345 7y agoIf you’re just handling requests there isn’t much for shared state, so you don’t have to worry about synchronization.
- pdonis 7y ago> If you’re just handling requests there isn’t much for shared state No, but if your single listener/server thread is managing epoll for all your file descriptors, you do have to have a way of synchronizing the worker threads with it, so they know when and when not to read from/write to their fd's. I assume Rachel is using some kind of semaphore or other threading synchronization mechanism for this.
- rantwasp 7y agoshould try this in erlang/elixir. i’m gonna bet you it could handle hundred of thousands of connections on a beefy machine (an million of connections w/ optimizations)
- unnouinceput 7y agowhy tho? In real life if you're in need of handling millions of users per second, I bet you're already part of FAANG, at which point you simply open offices in each country and deploy local servers.
- rantwasp 7y agonope. it’s about what’s possible.
- deleted 7y ago[deleted]
- splintercell 7y agoDoesn't WhatsApp story contradict to what you're saying? They handled millions of users per second, weren't part of FAANG and this helped them get acquired by FAANG and a high valuation for being a very nimble team and architecture.
- unnouinceput 7y agohow that contradicted me? I see this as exactly opposite, as in they became part of FAANG exactly because they managed to handle those users. And let's be real, they handled millions users/second after becoming Facebook. Like it or not FB is no.1 social network.
- ClikeX 7y agoThey got aquired in 2014. They hit 400M users in 2013. By then it was already THE messaging app for several European countries. I know amount of users doesn't equal users/second. But we shouldn't pretend like they weren't able to handle high traffic before Facebook aquired them.
- bjt 7y agoWhether intended or not, there's an undercurrent of "you're all so dumb for using Python" (or Ruby, or PHP, or other similarly performant language) here. I want to surface that and question it a bit. It's totally reasonable for a company to choose the Python/Gunicorn option if they already have a bunch of people who know Python and they don't need to serve tons of requests per second. Even if they do need to serve tons of requests per second, it's totally reasonable for them to still choose Python/Gunicorn if the cost of the additional servers is less than the cost of having to support multiple languages. Or if they get a lot of value from libraries that are unique to the Python ecosystem. Or if they care more about quickly iterating on features than driving down server costs. I agree that there's a point where it stops making sense, and there are plenty of engineers who don't recognize when they're past that point because they keep doubling down on sunk costs and things they're familiar with. But let's not be too quick to assume people are in that camp when we don't know all the tradeoffs they're facing.
- rumanator 7y ago> Even if they do need to serve tons of requests per second, it's totally reasonable for them to still choose Python/Gunicorn if the cost of the additional servers is less than the cost of having to support multiple languages. How hard is it to get up to speed on any other tech stack? ASP.NET Core is extremely fast and the learning curve is close to none, for example. If someone was able to wrap his head around backend development with Python I'm pretty sure they have the mental fortitude to onboard a tech stack that doesn't suffer from major performance problems.
- stev_stev 7y agoThis is where my head always goes as someone who does mostly Asp.Net Core. Why is it always between something like C++ or something like Python? Nowadays with middleware and endpoint routing, asp.net core can be almost as simple as flask (even if that’s not idiomatic or what the docs show you).
- flyinglizard 7y ago
- kragen 7y agoRachel presumably wrote her server in a reasonable language like C++ (though I don't see a link to her source), but when I wrote httpdito⁰ ¹ ² I wrote it in assembly, and it can handle 2048 concurrent connections on similarly outdated hardware despite spawning an OS process per connection, more than one concurrent connection per byte of executable†. (It could handle more, but I had to set a limit somewhere.) It just serves files from the filesystem. It of course doesn't use epoll, but maybe it should — instead of Rachel's 50k requests per second, it can only handle about 20k or 30k on my old laptop. IIRC I wrote it in one night. It might sound like I'm trying to steal her thunder, but mostly what I'm trying to say is she is right. Listen to her. Here is further evidence that she is right. As I wrote in https://gitlab.com/kragen/derctuo/blob/master/vector-vm.md https://gitlab.com/kragen/derctuo/blob/master/vector-vm.md, single-threaded nonvectorized C wastes on the order of 97% of your computer's computational power, and typical interpreted languages like Python waste about 99.9% of it. There's a huge amount of potential that's going untapped. I feel like with modern technologies like LuaJIT, LevelDB, ØMQ, FlatBuffers, ISPC, seL4, and of course modern Linux, we ought to be able to do a lot of things that we couldn't even imagine doing in 2005, because they would have been far too inefficient. But our imaginations are still too limited, and industry is not doing a very good job of imagining things. — ⁰ http://canonical.org/~kragen/sw/dev3/server.s http://canonical.org/~kragen/sw/dev3/server.s ¹ http://canonical.org/~kragen/sw/dev3/httpdito-readme http://canonical.org/~kragen/sw/dev3/httpdito-readme ² https://news.ycombinator.com/item?id=6908064 https://news.ycombinator.com/item?id=6908064 † It's actually bloated up to 2060 bytes now because I added PDF and CSS content-types to it, but you can git clone the .git subdirectory and check out the older versions that were under 2000 bytes.
- bob1029 7y agoI think going back to basics would be a really good idea for a lot of people in software. It seems like modern developers are more disconnected than ever from the reality of the hardware situation sitting right next to them. I believe there was a post on the front page today detailing a certain 22ms Hello World execution...
- lazyjones 7y agoThe problem with this kind of "benchmark" is that it doesn't measure anything relevant for realistic situations where thousands of connections will behave in arbitrary unexpected ways, like just stalling, and real web applications have absymal worst-case behaviour in case of I/O, cron-jobs running in the background, network hiccups etc.. You don't provision your systems with only best-case situations in mind. But sure, if you want to serve useless random numbers without ever even hitting the disk, a Raspberry PI is able to saturate its network connection.
- yowlingcat 7y ago``` First of all, it does not take "that much machine" to serve a fair number of clients. Ever since I wrote about the whole Python/Gunicorn/Gevent mess a couple of months back, people have been asking me "if not that, then what". It got me thinking about alternatives, and finally I just started writing code. ``` Another day, another questionable premise for a blog post. No, @rachelbythebay, the question is not "if not that, then what", and the answer is not reinventing the wheel. The question is just "what ___" -- what do you plan on doing, what does your software need to do, what does it need to support? Use the right tool for the right job. If you have a language you're proficient in and with an ecosystem that supports you developing something rapidly, it's borderline malpractice not to start there. When you need to optimize, optimize then. Maybe that means you carve out a subcomponent into a new service, and you choose a language purpose built for speedily doing what you need. Maybe it means a lot of things, but it doesn't mean you throwing out the baby with the bathwater and setting out to recreate the baby, the bathtub, and the bathwater from scratch to answer the question of why your tub is overflowing. I wish this blog post was about solving real engineering problems instead of writing code to provide mediocre answers to poor questions.
- Aeolun 7y ago> If you have a language you're proficient in and with an ecosystem that supports you developing something rapidly, it's borderline malpractice not to start there. I think the point of this post is that most new programmers do not know things can be faster than their monstrous JS blob. The solution to slow requests is more servers instead of fixing the code.
- WilliamEdward 7y agoIn what way is this helpful to newcomers at all? It uses a ton of heavy jargon and no example code.
- chris_wot 7y agoIt’s not aimed at introductory programmers. It’s aimed at more experienced programmers to suggest to them that they can show new programmers what’s possible.
- rb808 7y agoStuff like this worked great until someone tries to DDoS you, or found some buffer overflow which took over the box. I dont like the new world either but it was built this way for a reason.
- losvedir 7y agoI know pcwalton has been banging the "just use threads" drum for a while now. Rust used to use a green thread approach, but if I recall correctly, they ripped all that out for just native threads with the idea that in most cases it's fast and efficient enough. I remember when C10K was the big challenge, but even the naive approach of spawning a thread per connection now can handle that.
- birktj 7y agoI believe the reason Rust dropped green threads was to get rid of the runtime system and become a more systems language. Modern fast network code in Rust is based on async/cooperative multitasking distributed over num cpu worker threads which works very well.
- kenhwang 7y agoI've written a "just use threads" approach to a web server in Rust, and if you're just juggling IO and not doing any real work like most CRUD webapps, just about every other async-capable language scaled more gracefully and used less resources.
- whorleater 7y agoThe typical response to these types of posts is "oh your /toy/ server doesn't account for x, y, z in my use case, like ddos, network issues, etc. But how many people actually handle those cases in your production application? I can say for the majority of the applications I've written at large companies handling significant traffic API compatibility was far higher on the priority list than the cases that people often bring up. IMO she's right, I wish we didn't mess wrap around gunicorn and gevent for some of our services. Certainly would've made my life easier and the services faster.
- kragen 7y agoAlso it sounds like Rachel's server does account for DDoS and network issues.
- flerchin 7y agoMmmmm. I set up a local kafka cluster serving millions of connections. I'm not Rachel by the bay though.
- xakahnx 7y agoThe general attitude here reminds a bit of the following post from the architect of the Varnish proxy. I think the attitude comes down to the fact that modern kernels and in general the foundations of network programming are pretty strong. We should trust them more. https://varnish-cache.org/docs/5.2/phk/notes.html https://varnish-cache.org/docs/5.2/phk/notes.html
- mapgrep 7y agoI would argue you can say the same about foundations of rdbms systems as well. People build similar elaborate caches around those, for example rails has a “russian doll” cache layer built in, not realizing how much time has gone into developing well tuned caches within the database system itself, which simply needs to be allocated sufficiently large ram.
- tdeck 7y agoRussian doll caching also caches view rendering which can be non-trivial in Rails.
- flukus 7y ago> not realizing how much time has gone into developing well tuned caches within the database system itself File systems too. A cron job writing a csv makes a surprisingly simple cache the OS can keep in memory.
- sytringy05 7y agoCompare this to the Enterprise platform I am dealing with on a current project, which has 4 x ec2 nodes with 8 CPUs and 32 Gb RAM. I can DoS it with a single java client running 50 threads. If I use 100 the p95 shoots up to 30 - 40 seconds. But the kicker is that no one (other than me) really cares. 50 concurrent threads is probably around the peak load it will get in prod, and various people involved think why bother trying to fix it? It's driving me nuts. Thanks for listening
- bibabaloo 7y agoHonestly, I think that's what makes working at a large "web-scale" company so attractive to me. When you're running at that sort of scale you can't afford to be as apathetic about performance so there's a lot more engineering effort put into efficiency, because it makes financial sense to do so. OTOH, in a lot of enterprise type companies, you can be nothing more than a "feature monkey".
- Aeolun 7y agoOh man, don’t remind me. We have a bunch of GraphQL proxies in ECS that somehow cannot handle more than 5 connections each, so naturally the solution is to just spin up 19 more of them to get to 100 concurrent connections... All of them sit at 1% cpu as well.
- rbinv 7y agoThat actually made me laugh. The time savings can't possibly be worth it.
- peterwwillis 7y agoThe premise is that people don't understand their system, or software, and need to be told how it works. So you have an admittedly ignorant person telling other ignorant persons that there are possibilities out there. That's... not really useful. What is useful is to spend 2 days researching massively concurrent network applications, and find the ones that were already written, and see how they evolved over time. For the most part, it's just understanding your operating system and network protocols. Once you learn how they all work, the answers come quickly. This problem has been solved many times. But for the most part, none of you need to know how this stuff works. You can write the crappiest network server in the world, and there are still so many other components you can wrap around it to make it scale that you never even need to get close to network optimization. So you may have to run 10 instances of your app; who cares? We have virtually unlimited everything these days. The answer to a poorly performing app is "just throw more cloud at it". Also, I feel the need to remind everyone that single app instance handling 100K+ concurrent connections is a terrible fucking idea. What happens when the app crashes? What happens when the hardware dies? What happens when you need to, like, upgrade/restart the app? Several million SYN packets in 100ms, and default kernel TIME_WAIT settings, do not make great bedfellows.
- rachelbythebay 7y agoYeah, I know, I'm terrible. I don't know jack about this stuff. I should just stop now while I'm behind. Clearly.
- deleted 7y ago[deleted]
- Aeolun 7y ago> Also, I feel the need to remind everyone that single app instance handling 100K+ concurrent connections is a terrible fucking idea. How about two app instances?
- robrtsql 7y ago> Ever since I wrote about the whole Python/Gunicorn/Gevent mess a couple of months back, people have been asking me "if not that, then what". It got me thinking about alternatives, and finally I just started writing code. I actually want to know: then what? As a web developer who usually reaches for Django or Flask with Gunicorn because I just don't know any better, is there a better stack that doesn't face these problems? Or is this a 'call to action' for somebody to build a better web server that follows this advice?
- EdwardDiego 7y ago> is there a better stack Apparently, it's C, or ...assembly? According to the comment above yours. Because developer time is apparently cheaper than CPU cycles. Weird.
- kenhwang 7y agoEvery time I read one her posts, I think, wow she must either work for literally dirt cheap or her code is expected to run on several thousand machines. Most projects just don't reach the scale or steadystate where developer time is cheaper than machine time. It's fun trying to squeeze the last drop of blood from stone, but it rarely makes economical sense.
- disgruntledphd2 7y agoTo be fair, I believe she spent the guts of a decade at Google and Facebook as a Production Engineer, so this isn't really that surprising.
- kuschku 7y agoAs we've seen in the cloud costs thread, going from python on AWS to Rust on dedicated hardware can push your bills from 30'000$/month down to 300$/month, which more than pays for the dev salaries (especially if you're not paying the excessive and unnecessary salaries of the bay area)
- 7y ago
- renatovico 7y agouvicorn with quart in python 3.7 handle a 800-1000 req/s in gke :) porting flask to quart take a 2 months of work
- _4ziu 7y agoActually, now that i'm re-reading this, it's a disaster. She claims to write this to help newcomers, yet everything is so cryptic. `it kicks off a "serviceworker" thread to handle it.` It doesn't even tell me how I should do this. I don't know what 'serviceworker' code looks like. I don't know what 'kicking off' means. This post reads like it was made for maybe 3 or 4 people in the world who truly 'get it' and if you aren't in that elite club you're a terrible engineer, apparently. There's not even a lick of example code to get an idea of what is going on. Engineering is a big word that shouldn't be used in this blog post.
- 0xEFF 7y agoThat same old box could handle a million connections without the threads. In less than a hundred megabytes of ram too. Try it today with NGINX.
- di4na 7y agoThank you Rachel for saying loud what the erlang community say for years :) This is basically the erlang design. And yes it works really well.
- z3t4 7y agoYou must know a lot in order to write a slow performing program. If you just do a simple program like in the article, it will be fast, even if you do stupid things like spawning a new thread and file descriptor for each connection. Now in order to make it slow you must know enough stuff to introduce complexity to the program. To make a slow program you probably have to learn about frameworks, php, micro services, cloud databases, etc.
- l0b0 7y agoThe only endpoint to ever do anywhere near as little work as this example would be the heartbeat. Most of the cost comes from a combination of a bunch of things other than simply fetching some data from a local device: - Web-anything is fetched off of a DB nowadays. That's another crapton of latency, because a) it's just easier to understand its characteristics if it runs on a separate system and b) most companies IME have either no DBAs at all or the DBAs have no time to look in depth at every system being built. So the DB resources are vastly underutilized, and the DB itself is badly understood. - Cache invalidation is still the hardest problem, and every caching framework I've looked at seems to gloss over that part. Just cache all the things and hope people retry enough times to get the latest update. I would love someday to work on a system where things are aggressively cached at every level and invalidated at every level and with perfect granularity. - Building for web scale from the beginning is premature optimization for the vast majority of companies. In the vanishingly unlikely scenario that the company actually grows 100-fold or more it makes sense to start investing heavily in performance. Of course, this also has the knock-on effect that the vast majority of software developers never get anywhere near a web scale system. OTOH it creates jobs for millions of developers, some of whom might end up building at scale someday. Another elephant in the room is that building anything at web scale is just not something anybody straight into the workforce is anywhere near qualified for. We desperately need more focused learning (mentoring, pairing, etc.) across the board to bring everybody up to speed faster.
- sandGorgon 7y agoFastapi - a pleasant-to-use async python framework with strong type checking and lots of stuff built in - comes in at rank 68 on Techempower database update benchmarks. https://www.techempower.com/benchmarks/#section=data-r18&hw=ph&test=update https://www.techempower.com/benchmarks/#section=data-r18&hw=... It's about 30% slower than the fastest golang equivalent. For multiple-queries benchmark, its about 40% slower. https://www.techempower.com/benchmarks/#section=data-r18&hw=ph&test=query https://www.techempower.com/benchmarks/#section=data-r18&hw=... Once I start bringing Numba for accelerating computational usecases... I guess the difference will be even smaller.
- nromiun 7y agoAnd tomorrow there will be an article describing an exploit in a web service written in C/C++. Does she even see the size of the batteries included in a framework like Django? Here is some brand new information. Everyone knows Python/Django is slow and inefficient (same for rails) but they still use it for those batteries. It is easy to write some web service in a low level language that just crunches some numbers for your benchmark. It quickly gets complicated when you start thinking about accounts, security, passwords, databases, orders, carts etc.
- bibyte 7y agoDoes anyone have a link to the source code? I was thinking about writing some code in asyncio to compare but I couldn't find the code.
- dangerface 7y agoOld box, dumb code, few thousand connections, no big deal. Old box, complicated code, few thousand connections, good fucking luck.