defenseunicorns / kubernetes-fluent-client

A @kubernetes/client-node fluent API wrapper that leverages K8s Server Side Apply for use with https://pepr.dev
Apache License 2.0
13 stars 4 forks source link

fix: keep alive on socket #360

Closed cmwylie19 closed 2 months ago

cmwylie19 commented 2 months ago

Description

Enable keep-alive functionality on the response.body from the watch call. This will probe when the socket is idle, hopefully resulting in less missed events from the watcher.

Related Issue

Fixes #

Relates to #

Type of change

Checklist before merging

cmwylie19 commented 2 months ago

Soak testing this right now

After doing two soak tests for 115m and 114m respective, one without the keepAlive, the other with, here are the results:

Note: a watch_failure is when the informer does not react to a subscribed event from the watch within 10 seconds. In these cases Pepr would rely on the informer logic to clean it up.

  1. Without setKeepAlive (Original), Image: v0.34.1 image

  2. With setKeepAlive (Custom KFC), Image: pepr:dev image

They ended up performing very similarly, missing the same number of events (4), and in the first 3 windows having to remediate on an avg ~14 events.

cmwylie19 commented 2 months ago

Since we did not see a difference in terms of performance we are going to close this PR although we are going to continue looking for improvements to the watch connection.