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

Fix TCP close events for "idle" connections. Fixes #217 #220

Merged
merged 3 commits into from
Feb 10, 2025
Merged

Conversation

haesbaert
Copy link
Contributor

Change the condition to supress a close, before it would supress any sockets that had no traffic.

Now we keep state of sockets we sent an attempt/accept and supress the ones we didn't track AND had no traffic. The map is limited, once we have 128k active sockets we can't track them, so fallback to looking at bytes_received and bytes_sent.

We don't really look at tgid, but we will on upcoming probes. Maps are not small, most of the allocation size goes to the hash bucket. The empty map wires 2MB of memory.

6306: hash name sk_to_tgid flags 0x1
key 8B value 4B max_entries 131072 memlock 2098760B
btf_id 5117
pids EventsTrace(2868637)

Change the condition to supress a close, before it would supress any sockets
that had no traffic.

Now we keep state of sockets we sent an attempt/accept and supress the ones we
didn't track _AND_ had no traffic. The map is limited, once we have 128k active
sockets we can't track them, so fallback to looking at bytes_received and
bytes_sent.

We don't really look at tgid, but we will on upcoming probes.
Maps are not small, most of the allocation size goes to the hash bucket. The
empty map wires 2MB of memory.

6306: hash  name sk_to_tgid  flags 0x1
        key 8B  value 4B  max_entries 131072  memlock 2098760B
        btf_id 5117
        pids EventsTrace(2868637)
@haesbaert haesbaert marked this pull request as ready for review February 10, 2025 17:10
@haesbaert haesbaert requested a review from a team as a code owner February 10, 2025 17:10
Copy link
Contributor

@nicholasberlin nicholasberlin left a comment

Choose a reason for hiding this comment

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

LGTM

@haesbaert haesbaert merged commit c8934b4 into main Feb 10, 2025
26 checks passed
@haesbaert haesbaert deleted the fix-tcp branch February 10, 2025 19:49
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.

3 participants