From 53d968a922f4ea065386023ffc6db1ba14e120d8 Mon Sep 17 00:00:00 2001 From: Hau Nguyen Date: Thu, 17 Aug 2023 16:48:31 +0700 Subject: [PATCH] feat: add GOMEMLIMIT --- docs/2022-06-08-dockerfile-go.html | 11 +++++++++++ posts/2022-06-08-dockerfile-go.md | 5 +++++ 2 files changed, 16 insertions(+) diff --git a/docs/2022-06-08-dockerfile-go.html b/docs/2022-06-08-dockerfile-go.html index 149eb98..ec553a5 100644 --- a/docs/2022-06-08-dockerfile-go.html +++ b/docs/2022-06-08-dockerfile-go.html @@ -152,6 +152,10 @@
  • -trimpath to support reproduce build.
  • -ldflags="-s -w" to strip debugging information.
  • +

    Also there are some experiment:

    +
    FROM gcr.io/distroless/base-debian11
     
    @@ -184,6 +188,13 @@
               >Shrink your Go binaries with this one weird trick
           
    +      
  • + GOMEMLIMIT is a game changer for high-memory applications +
  • diff --git a/posts/2022-06-08-dockerfile-go.md b/posts/2022-06-08-dockerfile-go.md index 2c64600..0a9093e 100644 --- a/posts/2022-06-08-dockerfile-go.md +++ b/posts/2022-06-08-dockerfile-go.md @@ -90,6 +90,10 @@ This is where I build Go program. - `-trimpath` to support reproduce build. - `-ldflags="-s -w"` to strip debugging information. +Also there are some experiment: + +- `GOMEMLIMIT=1024MiB`: soft memory limit. + ```Dockerfile FROM gcr.io/distroless/base-debian11 @@ -104,3 +108,4 @@ Finally, I copy `app` to Distroless base image. - [How to start a Go project in 2023](https://boyter.org/posts/how-to-start-go-project-2023/) - [Shrink your Go binaries with this one weird trick](https://words.filippo.io/shrink-your-go-binaries-with-this-one-weird-trick/) +- [GOMEMLIMIT is a game changer for high-memory applications](https://weaviate.io/blog/gomemlimit-a-game-changer-for-high-memory-applications)