Live data from Hacker News

Kamal Proxy – A minimal HTTP proxy for zero-downtime deployments

github.com

121–130 of 133 posts

Re: Kamal Proxy – A minimal HTTP proxy for zero-downtime deployments

#121

Earlier quoted context omitted.

While network latency may overshadow that of a single query, many apps have many such queries to accomplish one action, and it can start to add up. I was referring more to how it's extremely rare to have a stack as simple as request --> LB --> app --> DB. Instead, the app almost always a micro service, even when it wasn't warranted, and each service is still making calls to DBs. Many of the services depend on other s…

> While network latency may overshadow that of a single query, many apps have many such queries to accomplish one action, and it can start to add up. I don't think this is a good argument. Even though disk latencies can add up, unless you're doing IO-heavy operations that should really be async calls, they are always a few orders of magnitude smaller than the whole response times. The hypothetical gains you get from…

Did you miss where I said “…each service is still making calls to DBs. Many of the services depend on other services…?”

I’ve seen API calls that result in hundreds of DB calls. While yes, of course refactoring should be done to drop that, the fact remains that if even a small number of those calls have to read from disk, the latency starts adding up.

It’s also not uncommon to have horrendously suboptimal schema, with UUIDv4 as PK, JSON blobs, etc. Querying those often results in lots of disk reads simply due to RDBMS design. The only way those result in anything resembling acceptable UX is with local NVMe drives for the DB, because EBS just isn’t going to cut it.

Re: Kamal Proxy – A minimal HTTP proxy for zero-downtime deployments

#122
post #55

This primarily exists to take care of a fundamental issue in Docker Swarm (Kamal's orchestrator of choice) where replacing containers of a service disrupts traffic. We had the same problem (when building JAMStack servers at Cloud 66) and used Caddy instead of writing our own proxy and also looked at Traefik which would have been just as suitable. I don't know why Kamal chose Swarm over k8s or k3s (simplicity perhaps?…

Where did you see that Kamal uses Docker Swarm ? As far as I can tell it doesn't use it.

Re: Kamal Proxy – A minimal HTTP proxy for zero-downtime deployments

#124

Earlier quoted context omitted.

As SRE, that PR scares me. There is no long explanation of why we are throwing out third party, extremely battle tested HTTP Proxy software for our own homegrown except "Traefik didn't do what we wanted 100%". Man, I've been there where you wish third party software had some feature but writing your own is WORST thing you can do for a company 9/10 times. My current company is dealing with massive tech debt because of…

> Man, I've been there where you wish third party software had some feature (...) It looks to me that they were already using Traefik, and Traefik does indeed support the feature they wished to have. Apparently they also got rid of support for healthchecks, which all by itself would be expected to require an extensive justification. But no. I would love to hear why the people behind this decision felt that Traefik's…

> Apparently they also got rid of support for healthchecks

The did not remove support for healthchecks. They're directly mentioned in the README.

> It will immediately begin running HTTP health checks to ensure it's reachable and working and, as soon as those health checks succeed, will start routing traffic to it.

I don't know. This has vibes of doing little to no research and then shit-talking a product.

Re: Kamal Proxy – A minimal HTTP proxy for zero-downtime deployments

#126
post #17

Earlier quoted context omitted.

First step is to decouple migrations from deploys, you want manual control over when the migrations run, contrary to many frameworks default of running migrations when you deploy the code. Secondly, each code version has to work with the current schema and the schema after a future migration, making all code effectively backwards compatible. Your deploys end up being something like: - Deploy new code that works with…

There's a little bit more to it. Firstly you can deploy the migration first as long as it's forwards compatible (ie. old code can read from it). That migration needs to be zero downtime; it can't, for example, rewrite whole tables or otherwise lock them, or requests will time out. Doing a whole new schema is one way to do it, but not always necessary. In any case you probably then need a backfill job to fill up the n…

We recently wrote about how we decided to handle deleting tables etc. https://bigbinary.com/blog/rails-8-deleting-tables-columns-u...

Re: Kamal Proxy – A minimal HTTP proxy for zero-downtime deployments

#127

Earlier quoted context omitted.

They're using the autocert package which is the bare minimum. It's brittle, doesn't allow for horizontal scaling of your proxy instances because you're subject to Let's Encrypt rate limits and simultaneous cert limits. (Disclaimer: I help maintain Caddy) Caddy/Certmagic solves this by writing the data to a shared storage so only a single cert will be issued and reused/coordinated across all instances through the stor…

I doubt that 37signals themselves are using Kamal's new automatic SSL support, at least in their main apps, since they're running their apps behind Cloudflare. I'd love to see a deployment tool that's like Kamal, in that it's simpler than Kubernetes, but fronted by something mature like Caddy, that can be exposed directly to the Internet rather than running behind a CDN like Cloudflare.

My understanding is that even if you run behind Cloudfare, you need to secure your connection to Cloudfare with a certificate?

Re: Kamal Proxy – A minimal HTTP proxy for zero-downtime deployments

#128
post #55

This primarily exists to take care of a fundamental issue in Docker Swarm (Kamal's orchestrator of choice) where replacing containers of a service disrupts traffic. We had the same problem (when building JAMStack servers at Cloud 66) and used Caddy instead of writing our own proxy and also looked at Traefik which would have been just as suitable. I don't know why Kamal chose Swarm over k8s or k3s (simplicity perhaps?…

Kamal uses plain 'docker run' commands, there is no Swarm or orchestration. It's a simple tool basically replacing Capistrano.

Re: Kamal Proxy – A minimal HTTP proxy for zero-downtime deployments

#129

Did they mention anywhere why they decided to write their own proxy instead of using Traefik or something else battle tested?

I tried to put some reasoning here https://nts.strzibny.name/kamal-proxy/

But I don't think they ever published comparisons to anything else than Traefik

Re: Kamal Proxy – A minimal HTTP proxy for zero-downtime deployments

#130

Earlier quoted context omitted.

They're using the autocert package which is the bare minimum. It's brittle, doesn't allow for horizontal scaling of your proxy instances because you're subject to Let's Encrypt rate limits and simultaneous cert limits. (Disclaimer: I help maintain Caddy) Caddy/Certmagic solves this by writing the data to a shared storage so only a single cert will be issued and reused/coordinated across all instances through the stor…

I doubt that 37signals themselves are using Kamal's new automatic SSL support, at least in their main apps, since they're running their apps behind Cloudflare. I'd love to see a deployment tool that's like Kamal, in that it's simpler than Kubernetes, but fronted by something mature like Caddy, that can be exposed directly to the Internet rather than running behind a CDN like Cloudflare.

I'm using apps deployed with Kamal behind cloudflare and I set up some Traefik things to enable Let's Encrypt certs so the connection from my server to Cloudflare is SSL secured.
Post reply on HN