Live data from Hacker News

Cloudflare Pages: Best server tech since CGI-bin?

taras.glek.net

171–180 of 226 posts

Re: Cloudflare Pages: Best server tech since CGI-bin?

#171
post #169

I have been working on servers whether professionally as a software engineer or as a pre-teen making a The Simpsons fan website for a couple decades now. I have never once used that `cgi-bin`, never opened it, and still have no idea wtf it is.

In my experience it's this thing exclusively used in offensive security training/CTFs. Not really sure what the intended use is, but it sure gets owned a lot

Re: Cloudflare Pages: Best server tech since CGI-bin?

#173
This page inspired me to actually convert as well. I have just recently been forced out of the AWS free tier and for some reason my insistence on using terraform and preserving a dynamic lockable state was somehow costing me $20 a month in DynamoDB costs.

Anyways, the pages import to take an existing git repository with a slew of CMS systems (mine being Hugo) supported, and the ability to just publish it to a custom domain in a series of clicks was actually really simple.

I think I dedicated 30 minutes of entire work and just saved ~$20/month because of it.

Re: Cloudflare Pages: Best server tech since CGI-bin?

#174

Earlier quoted context omitted.

This sounds magical: > Durable Objects make this easy. Not only do they make it easy to assign a coordination point, but Cloudflare will automatically create the coordinator close to the users using it and migrate it as needed, minimizing latency.

It sounds magical. I would recommend trying it first... the experience of trying to actually build anything with it is quite un-magical. The documentation, CLI, workflow, and pricing (for sockets especially) all fall quite short.

I agree. I have learned as a general idea "use the fancy new thing if the pain of not using it is costing you a lot of money", because having your data nice and structured, typechecked in a relation DB with a query engine is the sweet spot for most applications. Firebase taught me this lesson. If you have an app with user ids and user profiles, and another records (plural) references them, you need a join, and non-relation databases suck at joining data.

Having data flung about the place in these objects sounds a bit scary (how do I back them up, and keep track of them, how do I join data from multiple objects, and what if those different objects are all around the world).

Re: Cloudflare Pages: Best server tech since CGI-bin?

#175

Earlier quoted context omitted.

They made emails and egress free because there is a lot of price gouging going on in the industry that stops people from starting businesses. https://blog.cloudflare.com/aws-egregious-egress/ Identity as service is another category that's egregiously priced, and it's usually priced based on monthly active users too, which is the worst. It would be great to see Cloudflare disrupting that one as well.

This. At this point in everything being "cloud native" fewer and fewer people and orgs have any experience building internet networks - buying transit (circuits), peering, etc. For players at Cloudflare, AWS, GCP, etc scale it's essentially free. The fact that many of them (other than Cloudflare) charge $0.08/GB or whatever for egress and that's just accepted because people think "that's what it costs" is wild to me.…

Wouldn't surprise me if it were in Freakonomics, but there is always a weird "charging point" for things based on old expectations that subsidies the enterprise.

Like the old 50c/m mobile phone calls, the 10c SMS messages, then when they were free, charging for international SMS and calls, now charging for data. It is the "whales" who spend a lot of money on mobile games. 1% fee for looking after your money, Etc.

I wonder what AWS will do if they have to make egress cheap! What is the next thing they can charge for that is actually cheap but people are happy to pay for.

Re: Cloudflare Pages: Best server tech since CGI-bin?

#176

Biggest advantage I find is pre-scoped request-level control over everything. When someone loads your page, every single asset request hits your worker. It's both extremely simple and exceptionally powerful. Choose which responses to modify, authenticate, proxy, redirect, or let through. All in a single file with a few dozen LOC. No complex pre-app devops, middleware or routing policies required (i.e. oh sorry that r…

I'm curious about cams, but I'm being greeted with "Your passphrase has expired" when I try to get it to "let me in"

Re: Cloudflare Pages: Best server tech since CGI-bin?

#177

The Cloudflare cloud experience is "being sold short by subpar documentation" right now because important elements of their ecosystem are being ramped up from beta status. They also have internal docs which aren't kept up to date with their actual product. I'd check back in a few months because their beta experience can be very touch-and-go.

I've noticed that Cloudflare documentation is lacking, but I rarely find information that is published on official sources that is out of date. I find the fact that there are two dozen sources of information out there for an AWS or Terraform configuration, but they're all still wrong because the API has since changed and the documentation wasn't cleaned up when the breaking change was made.

I have found that with Cloudflare's documentation that where it's lacking they have the ability to PR in changes and if you go back to a saved page, I've found them pleasantly updated numerous times.

Thankfully the cutting edge development is based off of open standards that you can easily build off of. I know personally that I've found most of the sticking points of developing against Cloudflare to be easily mitigated and just be an overall better experience as a customer than with another hosting provider.

It doesn't hurt that they aren't charging me all that much personally, but I have a day job that fills up the Cloudflare stock price just fine.

Re: Cloudflare Pages: Best server tech since CGI-bin?

#178

Potentially stupid question: how is this different from hosting a static site on S3 and using CloudFront as a CDN? Assuming I don't need server-side JS, I don't see the benefit.

If you use a static site generator and it's in gitops, you can drop all of the considerations of AWS and focus on one control panel inside of Cloudflare and the content of your page. That's the benefit.

Re: Cloudflare Pages: Best server tech since CGI-bin?

#179
post #131

Earlier quoted context omitted.

For better or worse fast CGI never took off much beyond PHP. Python, node, ruby, etc. all do their own thing with their own app servers and protocols. I mean sure something like python can use fast CGI but no one in that community uses it that way, everyone uses uWSGI, gunicorn, etc. Plain old CGI doesn't scale beyond toy usage--it spawns a process per request. So there really isn't a good single option for Cloudflar…

> Plain old CGI doesn't scale beyond toy usage--it spawns a process per request. I'd be willing to bet the opposite: CGI is more than enough for 80% of workload, performance-wise. There are a few good reasons why CGI isn't the best today: the tooling doesn't exist, the security model is really bad, and you can cram fewer websites on a single machine, so for the same number of websites you need more machines, and that…

Speed is the only reason CGI doesn't fly.

What do you think is the upper limit of requests per second, if your HTTP server does process-per-request? For simplicity, assume server class hardware, that each request does no work besides producing a response, and an upper bound of 10k unique remote addresses (i.e. no more than 10k concurrent connections in a different model).

How do you think those metrics compare to other designs? I have an affinity for the conceptual simplicity of CGI but I've never been able to get a process-per-request server within even an order of magnitude of the performance of the more common designs. But I could be missing something!

Also, how does this design adapt to HTTP/2?

Re: Cloudflare Pages: Best server tech since CGI-bin?

#180
post #131

Earlier quoted context omitted.

> Plain old CGI doesn't scale beyond toy usage--it spawns a process per request. I'd be willing to bet the opposite: CGI is more than enough for 80% of workload, performance-wise. There are a few good reasons why CGI isn't the best today: the tooling doesn't exist, the security model is really bad, and you can cram fewer websites on a single machine, so for the same number of websites you need more machines, and that…

Sure but developers don't want to bifurcate their service code and releases into a simple version using CGI and a dedicated app server version for when CGI doesn't scale for them or their users. They just want to write one python web app and run it everywhere. There's no way a CGI app can reach a million requests a second on the same hardware that a nodejs (single thread, worker loop) would take to do 1M RPS. Process…

Yep. Also, sharing resources between connections is (at best) very difficult using CGI, and its trivially easy using a stand-alone app server. You can just set up a global variable at process startup and you're done. (This is useful in just about every web app I've ever written - eg for the connection to a database, cached resources, cached renders of common pages, in-memory only security tokens, etc).

I also find the modern approach much easier to reason about and debug. I don't need Apache + fastCGI + php + php fastCGI + apache configuration to get started. I can just run `node server.js` and my web app works.

The fact that it also scales much better is a cherry on top.

Post reply on HN