‹ BackHN Continuity

Thread

I built the fastest PHP webserver in the world

44 points · 77 comments · EGreg

  1. etchalon · · focus · HN ↗
    I haven't used PHP as a daily workhorse in a decade, so I guess I don't understand why I would want a web server in pure PHP? Nginx exists.
    1. carlosjobim · · focus · HN ↗

      [dead]

      1. Capricorn2481 · · focus · HN ↗
        What a tedious reply. They're genuinely asking what the technical reasons for wanting that would be. You're reading it in the silliest way possible.
        1. carlosjobim · · focus · HN ↗
          PHP is stil the backbone of the internet and a great tool. I don't think that anybody has to explain why people would want to use it.

          If somebody doesn't want anything to do with PHP that's their decision, but why clog up the threads? And every HN post has a similar dismissive comment. Why?

          Unless you think HN is a personal inbox...

          1. nashashmi · · focus · HN ↗
            They are asking about why would you need an alternate system? What is the technical reason behind it? What’s the disadvantage in the current system? All while acknowledging that they used to work in PHP and haven’t recently so they understand a lot less.
          2. Capricorn2481 · · focus · HN ↗
            If you read the comment for more than half a second you'd see they're not questioning why someone would use PHP. They're asking why you would use this particular server over nginx/apache, given how robust their support is.

            Signed, a PHP developer.

    2. stackskipton · · focus · HN ↗
      It's generally easier to have language self-host itself because at scale, you will be running multiple instances of the application so instead of Ingress Controller -> Go self-hosted/Python Uvicorn, it becomes Ingress COntroller -> Apache -> PHP and if developer modifies the Apache in ways you are not expecting, stuff can break.
      1. bawolff · · focus · HN ↗
        I mean at scale you probably have TLS termination -> caching layer -> webserver -> fpm -> php. All probably written in different languages.

        I find this argument kind of unconvincing. At scale you want your components to be rock solid. This project is an interesting experiment, but i would never use it at scale until it matures a lot more.

        1. kstrauser · · focus · HN ↗
          I agree. Nginx, Caddy, Apache, etc have found and fixed a million edge cases you'd never think of just from reading and implementing the spec. I guarantee there's code in each of these along the lines of:

            # Send an extra 0x20 space character after this header's value, because
            # otherwise Chrome on Android 15 shifts into compatibility mode and
            # it takes 37x longer to render the page, which everyone will blame on
            # "the slow webserver". The spec doesn't say we *can't* add this, and
            # tells clients to ignore trailing space, and we've tested this with 483
            # other clients to demonstrate that it doesn't cause problems. ¯\_(ツ)_/¯ .
          
          Now, as a very cool hack, or for easier local development with one less dependency, or just to scratch a personal itch and see if it can even be done, right on! That's clever and I'm glad they did it!

          BTW, in your showdead (for wholly unclear reasons) comment about it using copy-on-write RAM semantics, that's just the Unix process model. The OS does all that courtesy of fork() and the server gets it for free.

        2. stackskipton · · focus · HN ↗
          First off, alot of companies don't have caching layer. It's not different languages, it's the fact that you have really capable webserver underneath. It's HAProxy -> Apache -> PHP vs HAProxy -> Golang (Net/HTTP) or HAProxy -> Python (Uvicorn) with a lot less knobs to manipulate.

          I'm Ops person who has supported larger PHP applications. I've had several outages because PHP developer dropped some Apache config to "fix" something that caused HAProxy to disconnect. I've almost never had this with Uvicorn or Net/HTTP.

          1. bawolff · · focus · HN ↗
            Of course it depends on what type of application you are running whether a caching layer like varnish makes sense. I'm not saying its universal just really common if you are operating at scale.
Open on Hacker News to reply ↗

Unofficial Hacker News client; not affiliated with Y Combinator.