Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reset ping interval on incoming and outgoing messages #932

Merged

Conversation

caspervonb
Copy link
Collaborator

@caspervonb caspervonb commented Apr 24, 2023

Closes #931
Partially resolves #923

@caspervonb caspervonb requested a review from Jarema April 24, 2023 14:23
@caspervonb
Copy link
Collaborator Author

Before

[165] 2023/04/24 22:29:14.913192 [DBG] [::1]:65097 - cid:11 - Client connection created
[165] 2023/04/24 22:29:14.914262 [TRC] [::1]:65097 - cid:11 - <<- [CONNECT {"verbose":false,"pedantic":false,"jwt":null,"nkey":null,"sig":null,"name":null,"echo":true,"lang":"rust","version":"0.29.0","protocol":1,"tls_required":false,"user":null,"pass":[REDACTED],"auth_token":null,"headers":true,"no_responders":true}]
[165] 2023/04/24 22:29:14.914312 [TRC] [::1]:65097 - cid:11 - "v0.29.0:rust" - <<- [PING]
[165] 2023/04/24 22:29:14.914318 [TRC] [::1]:65097 - cid:11 - "v0.29.0:rust" - ->> [PONG]
[165] 2023/04/24 22:29:14.915322 [TRC] [::1]:65097 - cid:11 - "v0.29.0:rust" - <<- [PUB foo 3]
[165] 2023/04/24 22:29:14.915332 [TRC] [::1]:65097 - cid:11 - "v0.29.0:rust" - <<- MSG_PAYLOAD: ["bar"]
[165] 2023/04/24 22:29:14.915340 [TRC] [::1]:65097 - cid:11 - "v0.29.0:rust" - <<- [PING]
[165] 2023/04/24 22:29:14.915345 [TRC] [::1]:65097 - cid:11 - "v0.29.0:rust" - ->> [PONG]
[165] 2023/04/24 22:29:15.918384 [TRC] [::1]:65097 - cid:11 - "v0.29.0:rust" - <<- [PUB foo 3]
[165] 2023/04/24 22:29:15.918426 [TRC] [::1]:65097 - cid:11 - "v0.29.0:rust" - <<- MSG_PAYLOAD: ["bar"]
[165] 2023/04/24 22:29:16.919889 [TRC] [::1]:65097 - cid:11 - "v0.29.0:rust" - <<- [PUB foo 3]
[165] 2023/04/24 22:29:16.919922 [TRC] [::1]:65097 - cid:11 - "v0.29.0:rust" - <<- MSG_PAYLOAD: ["bar"]
[165] 2023/04/24 22:29:16.960705 [DBG] [::1]:65097 - cid:11 - "v0.29.0:rust" - Client Ping Timer
[165] 2023/04/24 22:29:16.960769 [TRC] [::1]:65097 - cid:11 - "v0.29.0:rust" - ->> [PING]
[165] 2023/04/24 22:29:16.961063 [TRC] [::1]:65097 - cid:11 - "v0.29.0:rust" - <<- [PONG]
[165] 2023/04/24 22:29:17.919750 [TRC] [::1]:65097 - cid:11 - "v0.29.0:rust" - <<- [PUB foo 3]
[165] 2023/04/24 22:29:17.919791 [TRC] [::1]:65097 - cid:11 - "v0.29.0:rust" - <<- MSG_PAYLOAD: ["bar"]
[165] 2023/04/24 22:29:18.920137 [TRC] [::1]:65097 - cid:11 - "v0.29.0:rust" - <<- [PUB foo 3]
[165] 2023/04/24 22:29:18.920163 [TRC] [::1]:65097 - cid:11 - "v0.29.0:rust" - <<- MSG_PAYLOAD: ["bar"]
[165] 2023/04/24 22:29:19.924048 [TRC] [::1]:65097 - cid:11 - "v0.29.0:rust" - <<- [PUB foo 3]
[165] 2023/04/24 22:29:19.924096 [TRC] [::1]:65097 - cid:11 - "v0.29.0:rust" - <<- MSG_PAYLOAD: ["bar"]
[165] 2023/04/24 22:29:20.924407 [TRC] [::1]:65097 - cid:11 - "v0.29.0:rust" - <<- [PUB foo 3]
[165] 2023/04/24 22:29:20.924455 [TRC] [::1]:65097 - cid:11 - "v0.29.0:rust" - <<- MSG_PAYLOAD: ["bar"]
[165] 2023/04/24 22:29:21.925880 [TRC] [::1]:65097 - cid:11 - "v0.29.0:rust" - <<- [PUB foo 3]
[165] 2023/04/24 22:29:21.925933 [TRC] [::1]:65097 - cid:11 - "v0.29.0:rust" - <<- MSG_PAYLOAD: ["bar"]
[165] 2023/04/24 22:29:22.926211 [TRC] [::1]:65097 - cid:11 - "v0.29.0:rust" - <<- [PUB foo 3]
[165] 2023/04/24 22:29:22.926253 [TRC] [::1]:65097 - cid:11 - "v0.29.0:rust" - <<- MSG_PAYLOAD: ["bar"]
[165] 2023/04/24 22:29:23.927968 [TRC] [::1]:65097 - cid:11 - "v0.29.0:rust" - <<- [PUB foo 3]
[165] 2023/04/24 22:29:23.928011 [TRC] [::1]:65097 - cid:11 - "v0.29.0:rust" - <<- MSG_PAYLOAD: ["bar"]
[165] 2023/04/24 22:29:24.926678 [DBG] [::1]:65097 - cid:11 - "v0.29.0:rust" - Client connection closed: Client Closed

After

[165] 2023/04/24 22:30:29.121274 [TRC] [::1]:65101 - cid:12 - <<- [CONNECT {"verbose":false,"pedantic":false,"jwt":null,"nkey":null,"sig":null,"name":null,"echo":true,"lang":"rust","version":"0.29.0","protocol":1,"tls_required":false,"user":null,"pass":[REDACTED],"auth_token":null,"headers":true,"no_responders":true}]
[165] 2023/04/24 22:30:29.121319 [TRC] [::1]:65101 - cid:12 - "v0.29.0:rust" - <<- [PING]
[165] 2023/04/24 22:30:29.121323 [TRC] [::1]:65101 - cid:12 - "v0.29.0:rust" - ->> [PONG]
[165] 2023/04/24 22:30:29.123089 [TRC] [::1]:65101 - cid:12 - "v0.29.0:rust" - <<- [PUB foo 3]
[165] 2023/04/24 22:30:29.123101 [TRC] [::1]:65101 - cid:12 - "v0.29.0:rust" - <<- MSG_PAYLOAD: ["bar"]
[165] 2023/04/24 22:30:30.124537 [TRC] [::1]:65101 - cid:12 - "v0.29.0:rust" - <<- [PUB foo 3]
[165] 2023/04/24 22:30:30.124572 [TRC] [::1]:65101 - cid:12 - "v0.29.0:rust" - <<- MSG_PAYLOAD: ["bar"]
[165] 2023/04/24 22:30:31.126112 [TRC] [::1]:65101 - cid:12 - "v0.29.0:rust" - <<- [PUB foo 3]
[165] 2023/04/24 22:30:31.126144 [TRC] [::1]:65101 - cid:12 - "v0.29.0:rust" - <<- MSG_PAYLOAD: ["bar"]
[165] 2023/04/24 22:30:31.440495 [DBG] [::1]:65101 - cid:12 - "v0.29.0:rust" - Client Ping Timer
[165] 2023/04/24 22:30:31.440711 [TRC] [::1]:65101 - cid:12 - "v0.29.0:rust" - ->> [PING]
[165] 2023/04/24 22:30:31.441643 [TRC] [::1]:65101 - cid:12 - "v0.29.0:rust" - <<- [PONG]
[165] 2023/04/24 22:30:32.126949 [TRC] [::1]:65101 - cid:12 - "v0.29.0:rust" - <<- [PUB foo 3]
[165] 2023/04/24 22:30:32.126979 [TRC] [::1]:65101 - cid:12 - "v0.29.0:rust" - <<- MSG_PAYLOAD: ["bar"]
[165] 2023/04/24 22:30:33.127824 [TRC] [::1]:65101 - cid:12 - "v0.29.0:rust" - <<- [PUB foo 3]
[165] 2023/04/24 22:30:33.127869 [TRC] [::1]:65101 - cid:12 - "v0.29.0:rust" - <<- MSG_PAYLOAD: ["bar"]
[165] 2023/04/24 22:30:34.128542 [TRC] [::1]:65101 - cid:12 - "v0.29.0:rust" - <<- [PUB foo 3]
[165] 2023/04/24 22:30:34.128577 [TRC] [::1]:65101 - cid:12 - "v0.29.0:rust" - <<- MSG_PAYLOAD: ["bar"]
[165] 2023/04/24 22:30:35.130942 [TRC] [::1]:65101 - cid:12 - "v0.29.0:rust" - <<- [PUB foo 3]
[165] 2023/04/24 22:30:35.131115 [TRC] [::1]:65101 - cid:12 - "v0.29.0:rust" - <<- MSG_PAYLOAD: ["bar"]
[165] 2023/04/24 22:30:36.132955 [TRC] [::1]:65101 - cid:12 - "v0.29.0:rust" - <<- [PUB foo 3]
[165] 2023/04/24 22:30:36.132993 [TRC] [::1]:65101 - cid:12 - "v0.29.0:rust" - <<- MSG_PAYLOAD: ["bar"]
[165] 2023/04/24 22:30:37.133416 [TRC] [::1]:65101 - cid:12 - "v0.29.0:rust" - <<- [PUB foo 3]
[165] 2023/04/24 22:30:37.133642 [TRC] [::1]:65101 - cid:12 - "v0.29.0:rust" - <<- MSG_PAYLOAD: ["bar"]
[165] 2023/04/24 22:30:38.135014 [TRC] [::1]:65101 - cid:12 - "v0.29.0:rust" - <<- [PUB foo 3]
[165] 2023/04/24 22:30:38.135046 [TRC] [::1]:65101 - cid:12 - "v0.29.0:rust" - <<- MSG_PAYLOAD: ["bar"]
[165] 2023/04/24 22:30:39.135553 [DBG] [::1]:65101 - cid:12 - "v0.29.0:rust" - Client connection closed: Client Closed

@caspervonb caspervonb changed the title Reset ping interval on incoming message Reset ping interval on incoming and outgoing messages Apr 24, 2023
Copy link
Member

@Jarema Jarema left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@Jarema Jarema merged commit 84133e6 into nats-io:main Apr 24, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Reduce outgoing pings Constant CPU usage with axum/tower & ConnectOptions
2 participants