Live data from Hacker News

Nginx Unit – Universal web app server

github.com

11–20 of 201 posts

Re: Nginx Unit – Universal web app server

#11
Well I commend the Nginx team for trying something new and launching this, even though I'm not sure what I would use it for personally.

Slightly tangental, but it always irks me when I see these kinds of responses in JSON:

  {
      "success": "Reconfiguration done."
  }
Really this should be something like "result": "success". Using "success" as a key name tells me nothing about the data it's representing.

Re: Nginx Unit – Universal web app server

#13

Thought for a second that it included automatic TLS certificates but that is still done manually with Certbot, which also isn’t that difficult.

This thing will probably run in a bunch of VMs/containers behind a load balancer, so it's actually better that it doesn't try to obtain any certificates by default.

Even a small number of apps trying to get their own certificates at the same time can exhaust the Let's Encrypt quota for your domain, with serious consequences to your other online properties.

Re: Nginx Unit – Universal web app server

#15

Tested this with a moderately complex PHP Laravel app and got a 40% speed improvement. Very useful to be able to run multiple apps each using different lang runtimes/versions without needing separate docker containers.

40% improvement versus what? A docker container for nginx and another one for PHP?

Re: Nginx Unit – Universal web app server

#18

Tested this with a moderately complex PHP Laravel app and got a 40% speed improvement. Very useful to be able to run multiple apps each using different lang runtimes/versions without needing separate docker containers.

What were you using earlier?

Re: Nginx Unit – Universal web app server

#19
post #11

Well I commend the Nginx team for trying something new and launching this, even though I'm not sure what I would use it for personally. Slightly tangental, but it always irks me when I see these kinds of responses in JSON: { "success": "Reconfiguration done." } Really this should be something like "result": "success". Using "success" as a key name tells me nothing about the data it's representing.

I think this is trying to be a discriminated union type[1] in json. One way to do it is to have a ‘tag’ field that says “ok” or “err” or whatever and then other fields for the rest of the data (or an array with the tag in the first slot). Another is to have one field whose name is the tag and whose value is everything else (which is what happened here).

[1] eg one where the possible values are either Err() or Ok(), and the data inside could be more complex types instead of just strings

Re: Nginx Unit – Universal web app server

#20
post #15

Tested this with a moderately complex PHP Laravel app and got a 40% speed improvement. Very useful to be able to run multiple apps each using different lang runtimes/versions without needing separate docker containers.

40% improvement versus what? A docker container for nginx and another one for PHP?

Compared to nginx and PHP-FPM installed on a host machine. All running opcache, JIT etc. Was pleasantly surprised. Note this is up to 40%, not all apps we’ve run have seen same improvement.
Post reply on HN