Skip to content
This repository was archived by the owner on Dec 31, 2025. It is now read-only.
This repository was archived by the owner on Dec 31, 2025. It is now read-only.

Intermittent NATS Disconnection Behind Load Balancer #376

@rithvikgupta

Description

@rithvikgupta

We are experiencing disconnection issues when using NATS behind a load balancer. The client gets disconnected with the following error message:

10:42:38 Disconnected due to: read tcp 10.8.0.19:52465->51.21.46.456:4222: read: operation timed out, will attempt reconnect
10:42:41 Reconnected [nats://nats.uat.com:4222]
The connection is restored shortly after, but the disconnection disrupts application workflows. This issue occurs intermittently and seems related to the network configuration with the load balancer.

Deploy NATS server behind a load balancer.
Use a client to connect and observe intermittent disconnections.

Expected Behavior:
The client should maintain a stable connection to the NATS server without frequent disconnections.

Actual Behavior:
The client disconnects with a timeout error and reconnects after a short interval.

Logs:

Timestamp: 10:42:38
Error: Disconnected due to: read tcp 10.8.0.19:52465->51.21.46.456:4222: read: operation timed out
Possible Causes:

Can anyone help me to resolve this issue

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions