cancel
Showing results for 
Search instead for 
Did you mean: 

SOAP API: How to get status of draining node (active connections)?

SOLVED
tomasj
New Contributor

SOAP API: How to get status of draining node (active connections)?

Hi,

I am trying to create simple script to set a node as draining, then remove the node after all connections are gone.

I am able to add, remove nodes, set the draining, but cant figure out how to test draining has been completed.

Of course I can set up a time out for a minute or so after node is set to drain, but that doesn't feel efficient. 

I was also looking at getAllConnections() - but that is not really usable as our system is swamped with many connections and result is way to big to use it for periodical checking.

Any ideas?

Cheers

Tom

1 ACCEPTED SOLUTION

Accepted Solutions
markbod
Contributor

Re: SOAP API: How to get status of draining node (active connections)?

Hi Tom,

On the System.stats object you will find a getNodeCurrentConn( nodes ) method which might be your best option. It will show you how many TCP connections remain open to the node (including idle ones).

Alternatively you could use the getNodeTotalConn(nodes) method which will give you the number of requests sent to the node. If you check this number every x minutes until it stops increasing you will be able to detect when it has become idle.

Cheers,

Mark

View solution in original post

3 REPLIES 3
markbod
Contributor

Re: SOAP API: How to get status of draining node (active connections)?

Hi Tom,

On the System.stats object you will find a getNodeCurrentConn( nodes ) method which might be your best option. It will show you how many TCP connections remain open to the node (including idle ones).

Alternatively you could use the getNodeTotalConn(nodes) method which will give you the number of requests sent to the node. If you check this number every x minutes until it stops increasing you will be able to detect when it has become idle.

Cheers,

Mark

tomasj
New Contributor

Re: SOAP API: How to get status of draining node (active connections)?

Hi Mark, getNodeCurrentConn() is actually exactly what I was looking for!

Thanks a lot

Tom

xevilstar
Occasional Contributor

Re: SOAP API: How to get status of draining node (active connections)?

can you post the example code please ?