Git Product home page Git Product logo

automemlimit's People

Contributors

ading1977 avatar kimmachinegun avatar lubosd avatar rhafer avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

automemlimit's Issues

Feature: System memory limit

Proposal

Add system memory as an available provider in order to avoid OOMs when running outside of cgroups.

For workloads running outside of cgroups, or for systems without cgroups, it would be useful to have a provider that exposes the total system memory. This way you cold set a percent of system memory automatically as the limit.

Does this work properly for pod resources suggested by Kubernetes?

If it works normally, does automemlimit work without being affected by the resource with just the code of the example regardless of the size of the resource? I'm currently using it by setting it in the environment variable, but I'm not sure yet because it's been a while since the latest version.

Please consider logging by default

Hey, I just started using this package. I like it! But, I use it alongside automaxprocs, and I noticed automaxprocs always logs when it changes the GOMAXPROCS setting, whereas your package only logs when debug mode is enabled. I think since most people will use both packages, it would be nice if you also logged by default.

Make logger configurable as a stdlib compatible interface

Proposal

In order to support different logging libraries, it would be nice to have logging be an interface to something compatible with the current stdlib log package.

For example:

import "log"

type Logger interface {
	Fatalf(format string, v ...interface{})
	Errorf(format string, v ...interface{})
	Warnf(format string, v ...interface{})
	Infof(format string, v ...interface{})
	Debugf(format string, v ...interface{})
}

init() required?

Can you clarify whether it is required to put this code in an init() method?

Kubernetes pods considers requests value rather than limits values.

I have deployed a k8s pod with both automemlimit and automaxproc and I have set the resources to the following:

resources:
  limits:
    cpu: 2
    memory: 4Gi

  requests:
     cpu: 1
     memory: 2Gi

automemlimits uses the request value rather than the limits values set on the k8s manifest. Is this expected behavior?

automaxprocs uses the limits value set on manifest rather than the request value.

I was under the impression that automemlimits did the same thing for memory limits like automaxprocs did for cpu limits.

Am I missing something here?

Not working in Google Cloud Run

Hey, I'd also be interested in this. Well, not necessarily sigar, but rather having automemlimit "just work" even outside a container.

For my use case, I am using Google Cloud run, and currently automemlimit doesn't work because it can't see it is running in a container. Specifically, I get the message

2023/04/23 01:40:07 failed to set GOMEMLIMIT: open /sys/fs/cgroup/cgroup.controllers: no such file or directory.

Originally posted by @mbyio in #4 (comment)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.