Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Runaway memory growth/CPU utilization #94

Closed
marksteele opened this issue Nov 28, 2017 · 1 comment
Closed

Runaway memory growth/CPU utilization #94

marksteele opened this issue Nov 28, 2017 · 1 comment

Comments

@marksteele
Copy link

Hi,

I've implemented brakes in a Lambda function in AWS, and have seen a gradual performance degradation over the course of about an hour.

We can observe the lambda running slower and slower up until a point where it takes about 10-30 seconds for it to execute, whereas on a fresh startup, requests are processed within a few milliseconds.

Memory consumption appears to increase linearly.

Our usage looks like this:

class Foo extends Service {

    init(stuff) {
        return super.init(stuff)
        .then(res => {
            this.getFooCB = new Brakes(
                 this.getFoo.bind(this), // Bind the scope, or won't have access to class vars
                 {
                     circuitDuration: 15000,
                     timeout: 10000,
                     waitThreshold:0 // After how many requests should we check?
                 });            
        });
    }

   getFoo(stuff) {
      // do some async thing
   }

  useFoo() {
    return this.getFooCB.exec(stuff).then(res => {...});
  }

@awolden
Copy link
Owner

awolden commented Nov 28, 2017

Hey @marksteele. It looks like you closed this right away. Is this still an issue? Looking at the code, I would be concerned that maybe you are calling init and instantiating a new brakes instance on every request.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants