How nodes work in a cluster? #4314
-
I know that if only one node is used in the publish-subscribe mode, nats-server will have a buffer (max_pending) and write blocking time (write_deadline) when sending messages to subscribers. If one of these two is reached, the server will Identify the subscriber as a slow consumer and disconnect. Now suppose there is a cluster, the publisher publishes a message to node A, and the subscriber subscribes to the message on node B, then node A will forward the message to node B, I would like to know whether there is buffering or write blocking between nodes and node forwarding Time, I didn't find this in the documentation (sorry if there is, and hope you can help me point it out). If so, how should I set it up. If not, are there any other measures in the face of insufficient bandwidth or disconnection between nodes? I also found that the value of max_payload cannot limit the message from the node. For example, node A sets max_payload to 2MB, node B sets max_payload to 1MB, then when node A sends a 2MB message to node B, node B and its subscription The recipient will receive this 2MB message, is this normal? Another problem is where I found ambiguity in the docs when reading about maxReconnects; |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 11 replies
-
The slow consumer between servers is limited to time vs size like clients. So it is possible to get a slow consumer on a route or gateway but only due to system call to pwrite() taking more that 10s (you can configure this). If the system sends a message it is not bound by same max payload rules, by design. For the reconnect, we strive to have all clients behave similarly, but will loop in @scottf for details there. |
Beta Was this translation helpful? Give feedback.
-
@Gutaicheng The documentation needs to be updated. Max retries is the number of times to retry to connect to each known server. So if there are 5 servers and you set max reconnect to 3,
I think an example is an easier way to demonstrate this
|
Beta Was this translation helpful? Give feedback.
The slow consumer between servers is limited to time vs size like clients. So it is possible to get a slow consumer on a route or gateway but only due to system call to pwrite() taking more that 10s (you can configure this).
If the system sends a message it is not bound by same max payload rules, by design.
For the reconnect, we strive to have all clients behave similarly, but will loop in @scottf for details there.