Live data from Hacker News

Cloud Run adds min instances feature for latency-sensitive apps

cloud.google.com

31–40 of 65 posts

Re: Cloud Run adds min instances feature for latency-sensitive apps

#31

This is a response to this AWS Lambda launch, over a year later: https://aws.amazon.com/blogs/compute/new-for-aws-lambda-pred...

Cloud Run is for containers, not functions, and it's the next evolution of App Engine. The GCP equivalent to Lambda is Cloud Functions.

Did Cloud Functions launch the equivalent to Lambda launch yet?

Re: Cloud Run adds min instances feature for latency-sensitive apps

#32
post #12
post #9

AppEngine has had scale-to-zero for 15 years, but instead of having a coherent product strategy, why not just launch a different competing product every year which is missing features that already exist? AppEngine vs Cloud Functions vs Cloud Run, the reasons these all exist at the same time is not because it makes any sense for customers, but because Google PMs get promoted for launching new things rather than suppor…

I disagree. App Engine is nothing like Cloud Functions/Run. The former is a better fit for your entire app stack (think Heroku) while the latter is for ad-hoc. As for Cloud Functions and Cloud Run, the way you deploy is completely different. Cloud Run is strictly meant for containers.

I would be interested in something like AWS Lambda@Edge or Cloud Workers from Google. Love to run a simple script close the visitor's location e.g. from Belgium DC instead of US DC etc

Re: Cloud Run adds min instances feature for latency-sensitive apps

#33
``` package main

import ( "fmt" "log" "net/http" )

func init() { setupDBConnection(dbName) }

func handler(w http.ResponseWriter, r *http.Request) {

    fmt.Fprintf(w, "Hi there, I love %s!", r.URL.Path[1:])
}

func main() { fmt.Println("Processing your serverless request") http.HandleFunc("/", handler) log.Fatal(http.ListenAndServe(":8080", nil)) }

```

This code snippet is an example of "Run bootstrapping logic once, and reuse it across Min Instances".

Assuming the boostrapping logic refers to the `init()` function that connects to DB. Does Cloud Run looks for init() in a Golang app to invoke?

I cannot seem follow the code's logic and its connection with the stated purpose.

Did I miss anything?

Re: Cloud Run adds min instances feature for latency-sensitive apps

#34

``` package main import ( "fmt" "log" "net/http" ) func init() { setupDBConnection(dbName) } func handler(w http.ResponseWriter, r *http.Request) { fmt.Fprintf(w, "Hi there, I love %s!", r.URL.Path[1:]) } func main() { fmt.Println("Processing your serverless request") http.HandleFunc("/", handler) log.Fatal(http.ListenAndServe(":8080", nil)) } ``` This code snippet is an example of "Run bootstrapping logic once, and…

`init()` is part of Golang spec: https://golang.org/ref/spec#Package_initialization

Re: Cloud Run adds min instances feature for latency-sensitive apps

#36
post #12

Earlier quoted context omitted.

I disagree. App Engine is nothing like Cloud Functions/Run. The former is a better fit for your entire app stack (think Heroku) while the latter is for ad-hoc. As for Cloud Functions and Cloud Run, the way you deploy is completely different. Cloud Run is strictly meant for containers.

> App Engine is nothing like Cloud Functions/Run. This isn't true. App Engine Flexible is in fact very similar to Cloud Run, and my understanding is that it runs on the same infrastructure. In fact, App Engine Flexible "Custom Runtime", which lets you load a docker container in App Engine, is very similar to Cloud Run. FWIW, though, as a user of App Engine Flexible for Node, I'm very glad this Cloud Run option now ex…

I've switched newer projects from app engine flexible to cloud run. I do think the underlying infrastructure is slightly different but for the better. If I remember correctly, app engine was using VMs vs pure containers. Deploys to app engine took me 10 min start to finish, but cloud run is around 3.

I used to use a combination of app engine standard and flexible depending on requirements, but I feel like cloud run gives me the benefits of both.

Re: Cloud Run adds min instances feature for latency-sensitive apps

#38
post #10
post #4

So if there's something always running .... isn't the same as having on always on server (with auto scaling of some sort)?

When a container is kept warm via " min-instances" but is not receiving requests ("idle"), its CPU costs 10x less than when it's actively processing requests, see pricing: https://cloud.google.com/run/pricing

How is this cost saving achieved? At the risk of being reductive, surely the container is either in memory and ready to serve requests or it isn't?

Re: Cloud Run adds min instances feature for latency-sensitive apps

#39
post #10
post #4

So if there's something always running .... isn't the same as having on always on server (with auto scaling of some sort)?

When a container is kept warm via " min-instances" but is not receiving requests ("idle"), its CPU costs 10x less than when it's actively processing requests, see pricing: https://cloud.google.com/run/pricing

Interesting, if an idle CPU costs 10x less, it ends up costing the same as 1 GB of memory, which amounts to about US$ 6/month each (Tier 1 pricing).

For an app with low usage, you start getting a price that can compete with Heroku.

Re: Cloud Run adds min instances feature for latency-sensitive apps

#40
post #10

Earlier quoted context omitted.

When a container is kept warm via " min-instances" but is not receiving requests ("idle"), its CPU costs 10x less than when it's actively processing requests, see pricing: https://cloud.google.com/run/pricing

How is this cost saving achieved? At the risk of being reductive, surely the container is either in memory and ready to serve requests or it isn't?

You still pay for RAM, just not CPU.
Post reply on HN