TCP Health check monitor in apigee

Not applicable

Hi,

I have a proxy configured with tcp monitor. Is there a way that I could check the communication between MP and the target server to which I am doing a health check? I would like to see how the health check is working by doing something similar to packet captures.

<HTTPTargetConnection>
    <URL>https://www.example.com</URL>
    <HealthMonitor>
        <IsEnabled>true</IsEnabled>
        <IntervalInSec>5</IntervalInSec>
        <TCPMonitor>
            <ConnectTimeoutInSec>3</ConnectTimeoutInSec>
            <Port>443</Port>
        </TCPMonitor>
    </HealthMonitor>
    <HTTPTargetConnection> 




0 3 1,346
3 REPLIES 3

If you have network access to the backend system (in your example, to the server listening on www.example.com) then you can use wireshark or tcpdump or similar to capture traffic and analyze it.

You may inductively verify the monitoring by taking the backend system offline, and verifying that the monitor works as expected.

If you use Apigee Edge SaaS, then you do not have access to the message processors, and so you cannot use tcpdump on those machines. If you use Apigee Edge "self-managed" on your own VMs, then you can use the wireshark or tcpdump technique on those machines, since you "own" them.

Does this help ?

Hi Dino,

Thanks for the response! I am able to see the tcp connections in the packet capture as this is on-premise. Even though the interval is set at 3 seconds, packet capture shows the ping happening every second. I will do few more captures to come to any conclusion on this part.

Other question that I have is - how to stop connection to backend if http/tcp monitor failed for a specified number of attempts, say 3. As per the documentation, <MaxFailures> needs to be a non-zero value but it is applicable when I have a load balancer configuration. What if I am running the health monitor for the api proxy that has a single backend as target endpoint and want the connection to the backend be barred for some time until the next health check is successful?

Not applicable

Hi Mohit,

Once the error count for a given target server reaches to the MaxFailures, the edge will stop sending the requests to the target server. That should be same even with one target server in load balancer configuration.

Please let me know if that works? Did you get a chance to try the above the configuration?

Thanks,

Ravibabu

,

Hi Mohit,

Keep the load balancer configuration with the one target server and maintain the MaxFailures to whatever the number you want to see. Failure count should increase the target server whenever health check fails and the request will not be sent to that target server until next successful health check. This is just my observation. Please let me know if you have tried out this.