Specifies connection persistence when backends are unhealthy. The
default value is DEFAULT_FOR_PROTOCOL. If set to
DEFAULT_FOR_PROTOCOL, the existing connections persist on unhealthy
backends only for connection-oriented protocols (TCP and SCTP) and
only if the Tracking Mode is PER_CONNECTION (default tracking mode)
or the Session Affinity is configured for 5-tuple. They do not
persist for UDP. If set to NEVER_PERSIST, after a backend becomes
unhealthy, the existing connections on the unhealthy backend are
never persisted on the unhealthy backend. They are always diverted
to newly selected healthy backends (unless all backends are
unhealthy). If set to ALWAYS_PERSIST, existing connections always
persist on unhealthy backends regardless of protocol and session
affinity. It is generally not recommended to use this mode
overriding the default. For more details, see Connection
Persistence for Network Load
Balancing <https://cloud.google.com/load-balancing/docs/network/networklb-backend-service#connection-persistence>
and Connection Persistence for Internal TCP/UDP Load
Balancing <https://cloud.google.com/load-balancing/docs/internal#connection-persistence>.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-08-28 UTC."],[],[],null,["# Class ConnectionPersistenceOnUnhealthyBackends (0.1.5)\n\nVersion latestkeyboard_arrow_down\n\n- [0.1.5 (latest)](/python/docs/reference/google-cloud-compute-v1beta/latest/google.cloud.compute_v1beta.types.BackendServiceConnectionTrackingPolicy.ConnectionPersistenceOnUnhealthyBackends)\n- [0.1.4](/python/docs/reference/google-cloud-compute-v1beta/0.1.4/google.cloud.compute_v1beta.types.BackendServiceConnectionTrackingPolicy.ConnectionPersistenceOnUnhealthyBackends) \n\n ConnectionPersistenceOnUnhealthyBackends(value)\n\nSpecifies connection persistence when backends are unhealthy. The\ndefault value is DEFAULT_FOR_PROTOCOL. If set to\nDEFAULT_FOR_PROTOCOL, the existing connections persist on unhealthy\nbackends only for connection-oriented protocols (TCP and SCTP) and\nonly if the Tracking Mode is PER_CONNECTION (default tracking mode)\nor the Session Affinity is configured for 5-tuple. They do not\npersist for UDP. If set to NEVER_PERSIST, after a backend becomes\nunhealthy, the existing connections on the unhealthy backend are\nnever persisted on the unhealthy backend. They are always diverted\nto newly selected healthy backends (unless all backends are\nunhealthy). If set to ALWAYS_PERSIST, existing connections always\npersist on unhealthy backends regardless of protocol and session\naffinity. It is generally not recommended to use this mode\noverriding the default. For more details, see `Connection\nPersistence for Network Load\nBalancing \u003chttps://cloud.google.com/load-balancing/docs/network/networklb-backend-service#connection-persistence\u003e`**and `Connection Persistence for Internal TCP/UDP Load\nBalancing \u003chttps://cloud.google.com/load-balancing/docs/internal#connection-persistence\u003e`**."]]