Live data from Hacker News

Nginx Unit – Universal web app server

github.com

101–110 of 201 posts

Re: Nginx Unit – Universal web app server

#101
post #83

Nginx Unit + PHP seems to handedly out-perform Nginx + php-fpm[1][2][3]. Also, Docker environments running PHP via Nginx Unit will no longer need separate containers for http + fpm, as it works similar to Apache's mod_php. 1. https://habr.com/en/articles/646397/ 2. https://medium.com/@le_moment_it/nginx-unit-discover-and-ben... 3. https://github.com/nginx/unit/issues/6#issuecomment-38407362...

You don't need separate containers to run nginx and php-fpm.

Re: Nginx Unit – Universal web app server

#102
post #83

Nginx Unit + PHP seems to handedly out-perform Nginx + php-fpm[1][2][3]. Also, Docker environments running PHP via Nginx Unit will no longer need separate containers for http + fpm, as it works similar to Apache's mod_php. 1. https://habr.com/en/articles/646397/ 2. https://medium.com/@le_moment_it/nginx-unit-discover-and-ben... 3. https://github.com/nginx/unit/issues/6#issuecomment-38407362...

You don't need separate containers to run nginx and php-fpm.

Are you implying that docker containers don't run a unikernel that can only run one application at a time? /s

Re: Nginx Unit – Universal web app server

#104
post #32
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.

Unit has been around for half a decade. It feels like an evolution to something like Phusion Passenger, but it's not quite cloud-native. A lot of the documentation is tailored to installing directly on a server and some essentials (i.e. prometheus metrics) are missing. I briefly evaluated it for bringing a PHP team into our Kubernetes cluster, but then ended up writing a bit of Go code to proxy into a real nginx+fcgi…

wait, did that continue to use php-fpm? if not I want details plz! :D (especially around the logging sync, unless it’s just php-fpm configured to collect child process output)

Re: Nginx Unit – Universal web app server

#105

I switched to caddy from nginx and didn’t look back. Auto SSL wildcards was enough.

How is Caddys performance compared to nginx?

It's very good. In some cases better. For example Caddy can handle tens of thousands of certs without problem whereas nginx + Certbot would choke.

The difference is negligible to most people.

Re: Nginx Unit – Universal web app server

#106
post #32

Earlier quoted context omitted.

Unit has been around for half a decade. It feels like an evolution to something like Phusion Passenger, but it's not quite cloud-native. A lot of the documentation is tailored to installing directly on a server and some essentials (i.e. prometheus metrics) are missing. I briefly evaluated it for bringing a PHP team into our Kubernetes cluster, but then ended up writing a bit of Go code to proxy into a real nginx+fcgi…

wait, did that continue to use php-fpm? if not I want details plz! :D (especially around the logging sync, unless it’s just php-fpm configured to collect child process output)

Yes, it did, not too much magic going on, the Go proxy also was a replacement for supervisord so it started nginx and fpm, reaped zombies and pulled all the important logs into stdout/stderr. The most remarkable thing was how this revitalized a team that wrote boring PHP software limited to deploying via FTP on PHP 5.

They ended up really getting into stripping out every piece of PHP they didn't use because the image built PHP from scratch, eventually took over maintenance of the go piece and ported a bunch of their apps to Symphony. I was in a platform engineering team and they were one of the few teams to really torture test every feature we ever shipped to the point they'd report edge cases or a bug to us every other week or so.

As for the logging question, we configured Symphony to log to syslog, which was provided by the Go daemon via unix socket.

Re: Nginx Unit – Universal web app server

#107
post #79

Earlier quoted context omitted.

By Serde's classification, `success: {}` is a textbook externally tagged representation.

I wasn't familiar with Serde's description of this so that was a good read, thanks. Although I still think this is a bad example of an externally tagged representation. In the Serde example they have the key as "Request" then what follows is the request object. In this example, the "success" key is followed by an arbitrary string message, which isn't obvious at all.

The contents of each variant don't really matter here. The tag represents the variant, not the type contained inside of it. The Serde equivalent here would be:

    #[derive(Serialize, Deserialize)]
    #[serde(rename_all = "camelCase")]
    pub enum Response {
      Success(serde_json::Value),
      Error(serde_json::Value),
    }

Re: Nginx Unit – Universal web app server

#109
post #83

Nginx Unit + PHP seems to handedly out-perform Nginx + php-fpm[1][2][3]. Also, Docker environments running PHP via Nginx Unit will no longer need separate containers for http + fpm, as it works similar to Apache's mod_php. 1. https://habr.com/en/articles/646397/ 2. https://medium.com/@le_moment_it/nginx-unit-discover-and-ben... 3. https://github.com/nginx/unit/issues/6#issuecomment-38407362...

Those benchmark outcomes are ridiculously in nginx-unit’s favor over php-fpm, way more than I would have believed was possible. What is php-fpm doing architecturally that is so different to warrant such poor relative performance?

Re: Nginx Unit – Universal web app server

#110
post #56

This seems a lot more like how IIS works, unless I'm missing something? As an aside: it's always curious to see how the programming world has splintered into cliques that no longer hang out together. NGINX Unit is a "Universal" web server without support for C++, Rust, or ASP.NET! But PERL is supported, like the 1990s Linux cgi-bin world never went away.

In Linux where this is primarily expected to be used ASP.NET is extremely rare, as is C++ for web stuff, and Rust has a vanishingly small web presence still. Lots of people use Perl still though, if not for anything else, for legacy stuff. So might as well ask why it doesn't support Delphi.

I can’t say I know the percentage of Linux servers running ASP.NET Core but the percentage of ASP.NET Core apps running on Linux is no longer negligible. Bing runs it on Linux, iirc.

This isn’t the dark days of .NET Framework anymore.

Post reply on HN