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

Counter for logging active connections #157

Open
mbordash opened this issue Oct 16, 2020 · 0 comments
Open

Counter for logging active connections #157

mbordash opened this issue Oct 16, 2020 · 0 comments

Comments

@mbordash
Copy link

mbordash commented Oct 16, 2020

Hi,

In my SMTPserver service I setup the following logic:

onConnect ( session, callback ) {
       connCount++;
       logger.info( 'Number of concurrent connections: ' + connCount );
       return callback();
   },
   onClose( session ) {
       if( connCount >= 1 ) {
           connCount--;
       } else {
           connCount = 0;
       }
   },

This was working great and we were able to track connections over time in grafana, however, one of our customers now proxies requests through a load balancer. Our counters increase due to onConnect but onClose doesn't get called any more. I suspect it is because the loadbalancer now keeps connections open, or perhaps sends "ping/alive" requests which skews the numbers.

Can you advise on a better way to track client connections other than the way I'm doing it above?

Thank you,

Michael

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

1 participant