Live data from Hacker News

Redbird: A modern reverse proxy for Node

github.com

41–50 of 77 posts

Re: Redbird: A modern reverse proxy for Node

#41
post #34

Earlier quoted context omitted.

- node (whose main reason for existing is event driven IO) is in the same order of magnitude as nginx (whose main reason for existing is also event driven IO). I think sometimes people think node is ruby/python/php levels of performance. It isn't. - And as another comment mentions, developer productivity may be better than minor performance difference - you mentioned Caddy, same rationale applies here. - nginx is als…

Do you know of a performance benchmark that shows the current status? I can't find many that describe node not at those levels of performance, Especially against Ruby.

Sure: https://iwf1.com/apache-vs-nginx-vs-node-js-and-what-it-mean...

I haven't seen anyone compare Ruby to node perf, unless there's a non blocking variant of Ruby (looks like nio4r), in which case it would have similar perf.

Likewise node vs Python Tornado would be a good comparison.

Thing is, nio4r and Tornado aren't the standard library. Whereas node's stdlib is: node's file and socket read operations etc are non blocking, Python and Ruby equivs are not.

Also (addressing weird moderation - sudden downvotes when I mentioned other languages): please don't turn this into a lang tribal thing: I personally think Python is a better language than JavaScript, it just blocks by default. This isn't a matter of preference, it's a fact.

Re: Redbird: A modern reverse proxy for Node

#42
post #34
post #27

I am one of those JS guys who like to put JS/Node.js everywhere, but I do not get the problem Redbird is trying to solve: the Express.js doc is quite clear that for serious things, you should use a dedicated http server. [1] If you just want reverse-proxying, you can choose between the simplicity of Caddy or the power of Nginx (or Apache). Why would I want to run a JS app (that I know will be less performant) to do t…

- node (whose main reason for existing is event driven IO) is in the same order of magnitude as nginx (whose main reason for existing is also event driven IO). I think sometimes people think node is ruby/python/php levels of performance. It isn't. - And as another comment mentions, developer productivity may be better than minor performance difference - you mentioned Caddy, same rationale applies here. - nginx is als…

Python: we use the node event loop too now (https://magic.io/blog/uvloop-blazing-fast-python-networking/).

But actually, you could have setup a pure Python server instead of nginx for the last 10 years with twisted.

Not that you should not consider uring nginx anyway: it deals with caching, load balancing, has great tutorials, it's battle tested, and has tons of pluging.

But performance wise, WSGI is not Python.

Re: Redbird: A modern reverse proxy for Node

#45

Earlier quoted context omitted.

Its a local installation, inside the folder, instead on the operating system. Also, other people will automatically install it when the package is saves inside the package.json or yarn file. You can also limit the version you want with these files, that the end user dont need to think about. Just yarn install :)

serv() { docker run --rm --name "nginx-${1:-8000}" -p "${1:-8000}:80" "${@:2}" -v $PWD:/usr/share/nginx/html:ro caub/nginx-dev; } this is what I do to run a local static server, you could run nginx with a config for proxying on docker as well also yarn.. bleh, just npm, nowadays it's even faster (on linux)

source of caub/nginx-dev: https://github.com/caub/docker-images/tree/master/nginx-dev

Re: Redbird: A modern reverse proxy for Node

#46
post #27

I am one of those JS guys who like to put JS/Node.js everywhere, but I do not get the problem Redbird is trying to solve: the Express.js doc is quite clear that for serious things, you should use a dedicated http server. [1] If you just want reverse-proxying, you can choose between the simplicity of Caddy or the power of Nginx (or Apache). Why would I want to run a JS app (that I know will be less performant) to do t…

There are cases when performance is not your main focus but simplicity of use is. Like during development. I'd of course never use this in production, but it's perfect for my development needs.

I agree with the sentiment, but using nginx as a proxy is reasonably easy (at least after you make one that works and can reuse that configuration.)

The advantage of developing on as similar a platform to the projected production platform is that when you do deploy to a real environment, there are fewer nasty surprises.

Re: Redbird: A modern reverse proxy for Node

#47
post #32

Sorry, but what’s a reverse proxy?

It's where the server has a proxy that can fetch resources from different places. E.g. ServerA (proxy) get a request for /something, but then fetches it from ServerB (web server) and returns it to the client. It proxies the response to the client. The comparison is a forward proxy, which the client has, and a reverse proxy is where it's on the server side.

Got it. I'm actually doing it using nginx to forward to node... Didn't know that's how it was called...

Re: Redbird: A modern reverse proxy for Node

#48
post #27

I am one of those JS guys who like to put JS/Node.js everywhere, but I do not get the problem Redbird is trying to solve: the Express.js doc is quite clear that for serious things, you should use a dedicated http server. [1] If you just want reverse-proxying, you can choose between the simplicity of Caddy or the power of Nginx (or Apache). Why would I want to run a JS app (that I know will be less performant) to do t…

> If you just want reverse-proxying, you can choose between the simplicity of Caddy or the power of Nginx (or Apache). Why would I want to run a JS app (that I know will be less performant) to do that?

The same reason you'd use Caddy over Nginx or Apache, why use the former over the the latter when the latter already exist and are faster? Because someone who knows Go but not C can customize its codebase, just like someone who knows JS but not C or Go can modify Redbird's.

If Node.js is good enough to build and run servers then it's good enough to build reverse proxies.

Re: Redbird: A modern reverse proxy for Node

#49
post #48
post #27

I am one of those JS guys who like to put JS/Node.js everywhere, but I do not get the problem Redbird is trying to solve: the Express.js doc is quite clear that for serious things, you should use a dedicated http server. [1] If you just want reverse-proxying, you can choose between the simplicity of Caddy or the power of Nginx (or Apache). Why would I want to run a JS app (that I know will be less performant) to do t…

> If you just want reverse-proxying, you can choose between the simplicity of Caddy or the power of Nginx (or Apache). Why would I want to run a JS app (that I know will be less performant) to do that? The same reason you'd use Caddy over Nginx or Apache, why use the former over the the latter when the latter already exist and are faster? Because someone who knows Go but not C can customize its codebase, just like so…

I have used apache since version 1.0 came out. I have never needed to modify the code.

If you use this logic, you would not be able to run Linux because it is written in C, correct?

Re: Redbird: A modern reverse proxy for Node

#50
post #34

Earlier quoted context omitted.

- node (whose main reason for existing is event driven IO) is in the same order of magnitude as nginx (whose main reason for existing is also event driven IO). I think sometimes people think node is ruby/python/php levels of performance. It isn't. - And as another comment mentions, developer productivity may be better than minor performance difference - you mentioned Caddy, same rationale applies here. - nginx is als…

Python: we use the node event loop too now ( https://magic.io/blog/uvloop-blazing-fast-python-networking/ ). But actually, you could have setup a pure Python server instead of nginx for the last 10 years with twisted. Not that you should not consider uring nginx anyway: it deals with caching, load balancing, has great tutorials, it's battle tested, and has tons of pluging. But performance wise, WSGI is not Python.

Sure, I mentioned Tornado a few minutes before you posted this. Twisted obviously counts too, I dislike the non-PEP8 coding style it uses but that's off topic. I love Python's non blocking features, they're just not in the mainline VM right now. Here's hoping for a libuv or whatever else non blocking Python 4 VM / stdlib.
Post reply on HN