java - Exposing whether an application is undergoing GC via UDP -
the motivation behind question see whether can make theoretical load balancer more efficient edge-cases first applying regular strategy of nominating particular node route http request (say, via round robin strategy) , "peeking" internal state of system see whether undergoing garbage collection. if so, load balancer avoids node altogether , moves onto next one.
in ideal scenario, each node "emit" internal state every few seconds via udp message queue letting load balancer know nodes potentially "radio-active" if they're going through gc (i'm visualizing simple boolean).
the question here is: can tweak application tap jvm's internal state , (a) figure out whether we're in gc mode right instant (b) emit result via protocol (udp/http) on wire other entity (like mq or something).
there whole bunch of ways monitor , report on vm remotely. well-known protocol, example, snmp. complicated subject.
implementation sort of depends on requirements. if need sure vm in state, might need wrap application in wrapper vm controls actual vm. pretty involved.
many implementations use built-in monitoring , profiling interfaces exposed beans participating applications via jmx. again, requires fair amount of tweaking.
i suppose create worker thread acts canary. broadcasts ping every x seconds, , if pinged service misses 2 or 3 pings, assumes vm not ready serve.
the problem deciding when vm never seems come back. vm, network, or else? how keep track of vms? these not intractable problems, combine in interesting ways make life equally interesting.
there lot of ways approach problem, , each has subtle implications.
Comments
Post a Comment