Live data from Hacker News

Old box, dumb code, few thousand connections, no big deal

rachelbythebay.com

141–150 of 288 posts

Re: Old box, dumb code, few thousand connections, no big deal

#141
post #61

Earlier quoted context omitted.

> 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 backe…

> How hard is it to get up to speed on any other tech stack? If I find myself debugging python tools, I usually just add debug statements to figure out WTF it is trying to do, and reimplement it in bash. It invariably is less than 10% as many lines of code, and also more debuggable / readable than the original. Granted, most of the python scripts I see these days are build processes or cluster coordinators.

> reimplement it in bash

> more debuggable / readable

More debuggable / readable for you, perhaps.

Re: Old box, dumb code, few thousand connections, no big deal

#142
post #22

What 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-a...

IDK but the mod_wsgi, although there seems to be a ton of documentation... It's way harder to install than a virtual environment, python and django. I love doing backend stuff in python and jinja but I fucking hate setting up wsgi on apache. It really makes me love php again.

Is there any reason why do you need mod_wsgi and apache? gunicorn behind nginx is an ideal setup for me (nginx handles static files and reverse proxying while gunicorn handles the python backend). I wrote a Dockerfile that combine all of those in a single package and I've been using it with very little tweaks for many of my smaller projects over the years and it makes deployment very easy.

Re: Old box, dumb code, few thousand connections, no big deal

#143
post #98
post #93

Earlier quoted context omitted.

PHP is fine too. Check out https://laravel.com/ and tell me that doesn't look like a joy to work with.

How much of the old "A fractal of bad design" post would you say still applies? That one post showcased so many footguns right at the language level that it spooked me away from it forever.

if you have an hour to spare, this (https://www.youtube.com/watch?v=wCZ5TJCBWMg) is a great talk by Rasmus Lerdorf, the creator of PHP, on the design of the language, the reason it ended up the way it did, and the ways that it is evolving for the better.

Re: Old box, dumb code, few thousand connections, no big deal

#144

> 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 pr…

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

Re: Old box, dumb code, few thousand connections, no big deal

#145

``` 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 n…

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

Re: Old box, dumb code, few thousand connections, no big deal

#146
post #116

Earlier quoted context omitted.

Any which language do you use for web apps if I may ask? Let me guess. Rust.

I primarily do all sorts of systems programming, but the few web backends I did were C# on Azure Functions and it was spectacular. I’m a very big proponent of Microsoft’s tooling and language development. The difference in productivity between C# and Python is such that they might as well have been developed by different civilizations. (I have occasionally used Python since about 2003 and C# since 2018)

> The difference in productivity between C# and Python is such that they might as well have been developed by different civilizations.

I think they were. Is that a bad thing?

Re: Old box, dumb code, few thousand connections, no big deal

#147

The 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…

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

Re: Old box, dumb code, few thousand connections, no big deal

#148

The 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

I 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.

Russian doll caching also caches view rendering which can be non-trivial in Rails.

Re: Old box, dumb code, few thousand connections, no big deal

#149
post #50

Rachel 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…

> I feel like with modern technologies like ... we ought to be able to do a lot of things that we couldn't even imagine doing in 2005...

As a self-taught programmer I would say that what all these less efficient bit easier to learn technologies have done is enable people like me who evidently are not geniuses like yourself to write software. Should programming always be an ivory tower thing?

Re: Old box, dumb code, few thousand connections, no big deal

#150

> 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 pr…

I don't know why rachel doesn't ever post source code or simply say what architecture she's using. I'm left to assume it's just plain c++.

I'll just stick to python thanks.

Post reply on HN