nats-io / nats-server

High-Performance server for NATS.io, the cloud and edge native messaging system.
https://nats.io
Apache License 2.0
15.49k stars 1.38k forks source link

Hot change max_payload in server config, but client not receive INFO_ARG message #4200

Closed taiheserver closed 1 year ago

taiheserver commented 1 year ago

i found nats only send INFO_ARG to client when client reconnect or server cluster had changed. i used simple nats version, not jetstream

derekcollison commented 1 year ago

Or when a server enters lame duck mode as well. That is correct for now.

taiheserver commented 1 year ago

But if server enters lame duck mode, it will stop. If i use jetstream, can I achieve hot update max_payload?

derekcollison commented 1 year ago

LameDuck will eventually exit but the client will have time to take action. We also plan on doing intelligent reconnect at some point for clients.

In terms of max_payload, what are you trying to use it for? In general there is little reason to change this value in the majority of systems.

taiheserver commented 1 year ago

When our system running online, we found some message too large to over max_payload, but we didn't want to stop the system. I set the max_payload to 6M, but after we updated, there was a message that it reached 7M, which was not tested by our test before going online. Then I signal SIGHUP to the server that I want to be able to hot-update max_payload,I sent the signal to all the nodes of the server cluster, but nats client didn't receive the configuration change. So I had to restart my service for the nats client to get the latest config again. Although changing max_payload is not a frequent operation, it still happens occasionally nats server version: 2.8.4 nats client is nats.go: 1.25.0

derekcollison commented 1 year ago

We go as high as 8MB for our enterprise offerings in NGS but in general I would avoid changing it and would look to upgrading your servers to the latest 2.9.17 and check out ObjectStore which can move large assets around.