• gmhafiz@programming.dev
    link
    fedilink
    arrow-up
    59
    ·
    11 months ago

    1.2 million page views per month

    1,200,000 / 30 days / 24 hours / 60 minutes / 60 seconds is 0.46 requests per second.

    That is crazy low and is nothing to shout about. I notice people like to this in months to inflate the number to looks bigger. But calculating it down to RPS puts it to a perspective.

    So why not create a website out of really, really old technology?

    PHP 8.0 is no longer supported so I hope they update the “really, really old technology” to at least PHP 8.1 today.

      • myersguy@lemmy.simpl.website
        link
        fedilink
        arrow-up
        8
        ·
        11 months ago

        $10-20 is what that VPS costs at a cloud provider. You could also dockerize and use a container service like GCP Cloud Run combined with cloud storage within that budget.

        I’m not a big node guy, but I also kind of doubt nodejs would fail to handle 10RPS on 2gb of memory. I guess it all depends on what the requests are doing.

      • Deckweiss@lemmy.world
        link
        fedilink
        arrow-up
        5
        ·
        edit-2
        11 months ago

        10-20$ ? I think it is way cheaper. I doubt they need a good CPU, some vcores will do.


        edit:

        Here is an 8GB 6vcore ARM VPS from a reputable German server host for 7€

        https://www.netcup.de/bestellen/produkt.php?produkt=3564

        Here is a 2GB 2vcore x86 for 3.25€

        https://www.netcup.de/bestellen/produkt.php?produkt=2948

        Not to mention - they have regular deals, where you can get them for a permanent 50% off (during black friday and winter sales) I have been paying 17€ per year for the 2GB version.

          • Deckweiss@lemmy.world
            link
            fedilink
            arrow-up
            5
            ·
            11 months ago

            The netcup vps I have has a 100% uptime during the past 5 years. But no heavy use ofc, just wireguard

          • Kissaki@programming.dev
            link
            fedilink
            English
            arrow-up
            2
            ·
            edit-2
            10 months ago

            I’ve been using netcup for a decade. They’re very reliable and high quality. (Management/Admin interface, functionality, help wiki. Never had reliability issues.)

            I’ve used other providers before. I’m very satisfied with netcup.

      • QuadriLiteral@programming.dev
        link
        fedilink
        arrow-up
        3
        ·
        11 months ago

        Indeed. They say they’ve been repeatedly featured on the front page of HN and the site didn’t fall over, I’ve seen many examples that did.

    • Spectacle8011@lemmy.comfysnug.space
      link
      fedilink
      arrow-up
      1
      ·
      11 months ago

      PHP 8.0 is no longer supported so I hope they update the “really, really old technology” to at least PHP 8.1 today.

      Most likely. This blog was written in February 2022; support for PHP 8.0 was only dropped in November 2023.

  • bitcrafter@programming.dev
    link
    fedilink
    English
    arrow-up
    24
    ·
    11 months ago

    Wait… I just noticed this:

    [XHTML] never took off on the web, in part because in a website context so much HTML is generated by templates and libraries that it’s all too easy to introduce a syntax error somewhere along the line; and unlike HTML, where a syntax error would still render something, the tiniest syntax error in XHTML means the whole thing gets thrown out by the browser and you get the Yellow Screen of Death.

    This confuses me; don’t you want to make sure you are always generating a syntactically valid document, rather than hoping that the browser will make something suitable up to work around your mistake?

    • polakkenak@feddit.dk
      link
      fedilink
      arrow-up
      14
      ·
      11 months ago

      The thing with XHTML is that even a minor problem will make the page refuse to render and display a full page error message instead of any content. Having the browser guess how to handle the malformed HTML isn’t ideal, but it’s a lot better than showing nothing at all.

      • atheken@programming.dev
        link
        fedilink
        arrow-up
        6
        ·
        11 months ago

        As an end result, maybe. But it also means that you get specific feedback on how to properly author it correctly and fix it before pushing it live.

        IDK, I lived through that whole era, and I’d attribute it more to the fact that HTML is easy enough to author in any text editor by complete novices. XHTML demands a hell of a lot more knowledge of how XML works, and what is valid (and, more keystrokes). The barrier to entry for XHTML is much, much, higher.

        • bitcrafter@programming.dev
          link
          fedilink
          arrow-up
          4
          ·
          11 months ago

          I completely agree with that assessment, but what is weird to me is that most people use frameworks so they don’t actually touch any of the markup themselves.

          • atheken@programming.dev
            link
            fedilink
            arrow-up
            3
            ·
            11 months ago

            I don’t know if it’s “most people,” but I agree, there is no excuse for frameworks producing sloppy output - that being said, XHTML is a bit more chatty than HTML(5), so there is some minor benefit to not using the less verbose standard.

    • DeLift@feddit.nl
      link
      fedilink
      arrow-up
      8
      ·
      11 months ago

      I feel the idea was that anyone should be able to make a webpage by just copy pasting snippits and to help with that html and Javascript will attempt to continue as best as it can, even if there are glaring issues.

        • DeLift@feddit.nl
          link
          fedilink
          arrow-up
          6
          ·
          11 months ago

          Oh yes, Front-end developers suffer this decision daily. Luckily there things like Typescript to ease the pain.

    • PixxlMan@lemmy.world
      link
      fedilink
      arrow-up
      4
      ·
      11 months ago

      That’s too sensible for the web. It almost makes sense, and there’s no fun compatibility problems to revel in!

    • adrian783@lemmy.world
      link
      fedilink
      arrow-up
      4
      ·
      11 months ago

      well, no. because broken html can still function sometimes. but most importantly most of html is not even “broken”, just not “adhering to the complete standards”.

      html is just formatting around the content. even completely devoid of html you can still see things. we’re not writing latex here and no one cares things are a little fucky.

      as far as generated html go, you’re more likely to break it further if you fuck with it anyways.

      • bitcrafter@programming.dev
        link
        fedilink
        English
        arrow-up
        2
        ·
        10 months ago

        Sure, but shouldn’t you want your generated markup to adhere to the complete standards so that you know it will be interpreted correctly, rather than hoping that the browser will make the correct guess about what you really meant?

        • adrian783@lemmy.world
          link
          fedilink
          arrow-up
          2
          ·
          10 months ago

          I mean yeah it would be nice but software isn’t perfect and validating html is not a sexy feature.

    • expr@programming.dev
      link
      fedilink
      arrow-up
      11
      ·
      11 months ago

      Modern PHP isn’t half bad, and it has at least two major benefit over some of its competitors: Each request is a totally independent request that rebuilds the world. There’s no shared state (unless you want there to be).

      …isn’t that how every web framework works?

        • expr@programming.dev
          link
          fedilink
          arrow-up
          3
          ·
          11 months ago

          Yikes, pretty bizarre considering stateless endpoints is the gold standard.

          Re: persistent process, that doesn’t seem like a big deal, to me. It’s pretty normal since you often want to keep some common stuff going, like metrics. Unless you’re doing something crazy it should really take next to no resources while idling.

          • adrian783@lemmy.world
            link
            fedilink
            arrow-up
            2
            ·
            11 months ago

            for content sites, stateless is fine. for web apps you need states of all different kinds. even the smallest detail is a state in an application.

            endpoints themselves are stateless, but the web application is stateful. you only have to build the world once, and its much friendlier for end users.

            • expr@programming.dev
              link
              fedilink
              arrow-up
              1
              ·
              10 months ago

              I wasn’t talking about frontend state, just the server. Frontend state is kind of irrelevant, tbh.

    • xigoi@lemmy.sdf.org
      link
      fedilink
      arrow-up
      3
      ·
      11 months ago

      Each request is a totally independent request that rebuilds the world. There’s no shared state (unless you want there to be).

      I with there was a language with this model, but without the language itself being completely garbage.

      • RonSijm@programming.dev
        link
        fedilink
        arrow-up
        6
        ·
        11 months ago

        Isn’t that the same as modern languages? For example in ASPCore / C#, you can just register all your services with a lifetime scoped to the request, and then there’s no shared state.

        If you want there to be a shared state, you’d just have to register your services with a higher lifetime scope, like with a singleton scope

      • redcalcium@lemmy.institute
        link
        fedilink
        arrow-up
        4
        ·
        edit-2
        11 months ago

        You can still use CGI with Apache. Apache will execute your program on each request and return its output from stdout as webserver response. If you have a form, it’ll get POSTed to stdin when Apache execute your program. You can write your program with whatever language you want as long as you can read stdin and write to stdout. It’s just tedious af so no one really use it these days. PHP was basically born because people got tired writing CGI program with pearl or C and want something more convenient. But with modern programming languages, perhaps CGI is not too bad, except the one process per request which will absolutely kill your server the moment you have visitors spike.

  • bitcrafter@programming.dev
    link
    fedilink
    English
    arrow-up
    6
    ·
    11 months ago

    Thanks, it’s actually kind of nice to hear someone who likes using PHP explaining in detail why they like it.