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

Statistics: negative number of active connections when using proxy. #760

Closed
hongzhidao opened this issue Sep 26, 2022 · 2 comments
Closed

Comments

@hongzhidao
Copy link
Contributor

Thanks for Tobias's report.
With the configuration, it caused wrong connection statistics.

{
     "match": {
         "uri": "/status/*"
     },

     "action": {
         "proxy": "[http://unix:/opt/unit/unit.sock](http://unix/opt/unit/unit.sock)"
     }
}
connections": {
     "accepted": 8,
     "active": -41,
     "idle": 0,
     "closed": 49
}

And here's the patch to fix it, welcome to test.
https://gist.github.com/hongzhidao/51fbc5169f22bd725d99446eca47e346

@tobiasge
Copy link

I tested the patch with a minimal configuration:

{
  "listeners": {
    "*:8080": {
      "pass": "routes"
    }
  },
  "routes": [
    {
      "match": {
        "uri": "/status/*"
      },
      "action": {
        "proxy": "http://unix:/home/tgenannt/LocalGit/unit/build/control.unit.sock"
      }
    }
  ],
  "access_log": "/dev/stdout"
}

and have the following statistics:

{
  "connections": {
    "accepted": 25,
    "active": 0,
    "idle": 0,
    "closed": 25
  },
  "requests": {
    "total": 25
  },
  "applications": {}
}

Active connections isn't negative anymore. Thanks for the quick help.

@hongzhidao
Copy link
Contributor Author

Hi @tobiasge

The fix patch has been committed, thanks again.
0711101

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