Skip to content

Provide configurable memory limit for Conn tracker buffer usage#2196

Merged
ddelnano merged 1 commit intopixie-io:mainfrom
ddelnano:ddelnano/add-conn-tracker-memory-limit
May 28, 2025
Merged

Provide configurable memory limit for Conn tracker buffer usage#2196
ddelnano merged 1 commit intopixie-io:mainfrom
ddelnano:ddelnano/add-conn-tracker-memory-limit

Conversation

@ddelnano
Copy link
Copy Markdown
Member

@ddelnano ddelnano commented May 9, 2025

Summary: Provide configurable memory limit for Conn tracker buffer usage

Some memory conscious users want to prevent PEM's from having unbounded memory use. The socket tracer's conn tracker component allows unbounded memory growth due to storing an uncapped amount of socket data. From profiling the PEM's heap use, this memory growth is a significant contributor to the PEM's memory footprint.

By leveraging the existing table store limit and this new configuration option, these memory conscious users run Pixie with a smaller and more predictable steady state memory usage.

Relevant Issues: N/A

Type of change: /kind feature

Test Plan: Ran perf_tool and k9s based load tests to verify the following:

  • Verified results by running PEM's with a 0.5-1 GiB memory limit
  • Verified Conn tracker buffers no longer showed up as significant memory contributors in heap profiles.

Changelog Message: PEM's can now limit the total memory used by Pixie's socket tracer buffers through the --total_conn_tracker_mem_usage command line flag or the PX_TOTAL_CONN_TRACKER_MEM_USAGE env var. This allows memory conscious users to have more predictable memory use when paired with PL_TABLE_STORE_TABLE_SIZE_LIMIT.

Signed-off-by: Dom Del Nano <[email protected]>
(cherry picked from commit aea0a95)
@ddelnano ddelnano requested a review from a team as a code owner May 9, 2025 22:05
@ddelnano ddelnano merged commit 244ab1b into pixie-io:main May 28, 2025
28 of 29 checks passed
@ddelnano ddelnano deleted the ddelnano/add-conn-tracker-memory-limit branch May 28, 2025 16:30
ddelnano added a commit to k8sstormcenter/pixie that referenced this pull request Feb 25, 2026
…e-io#2196)

Summary: Provide configurable memory limit for Conn tracker buffer usage

Some memory conscious users want to prevent PEM's from having unbounded
memory use. The socket tracer's conn tracker component allows unbounded
memory growth due to storing an uncapped amount of socket data. From
profiling the [PEM's heap
use](https://github.com/pixie-io/pixie/blob/301198f2af6739f0de8b01e1cbcb3451b3075e28/scripts/collect_heap_pprofs.sh),
this memory growth is a significant contributor to the PEM's memory
footprint.

By leveraging the existing [table store
limit](https://github.com/pixie-io/pixie/blob/301198f2af6739f0de8b01e1cbcb3451b3075e28/src/table_store/table/table.cc#L44)
and this new configuration option, these memory conscious users run
Pixie with a smaller and more predictable steady state memory usage.

Relevant Issues: N/A

Type of change: /kind feature

Test Plan: Ran perf_tool and k9s based load tests to verify the
following:
- [x] Verified results by running PEM's with a 0.5-1 GiB memory limit
- [x] Verified Conn tracker buffers no longer showed up as significant
memory contributors in heap profiles.

Changelog Message: PEM's can now limit the total memory used by Pixie's
socket tracer buffers through the `--total_conn_tracker_mem_usage`
command line flag or the `PX_TOTAL_CONN_TRACKER_MEM_USAGE` env var. This
allows memory conscious users to have more predictable memory use when
paired with `PL_TABLE_STORE_TABLE_SIZE_LIMIT`.

Signed-off-by: Dom Del Nano <[email protected]>
ddelnano added a commit to k8sstormcenter/pixie that referenced this pull request Feb 25, 2026
…e-io#2196)

Summary: Provide configurable memory limit for Conn tracker buffer usage

Some memory conscious users want to prevent PEM's from having unbounded
memory use. The socket tracer's conn tracker component allows unbounded
memory growth due to storing an uncapped amount of socket data. From
profiling the [PEM's heap
use](https://github.com/pixie-io/pixie/blob/301198f2af6739f0de8b01e1cbcb3451b3075e28/scripts/collect_heap_pprofs.sh),
this memory growth is a significant contributor to the PEM's memory
footprint.

By leveraging the existing [table store
limit](https://github.com/pixie-io/pixie/blob/301198f2af6739f0de8b01e1cbcb3451b3075e28/src/table_store/table/table.cc#L44)
and this new configuration option, these memory conscious users run
Pixie with a smaller and more predictable steady state memory usage.

Relevant Issues: N/A

Type of change: /kind feature

Test Plan: Ran perf_tool and k9s based load tests to verify the
following:
- [x] Verified results by running PEM's with a 0.5-1 GiB memory limit
- [x] Verified Conn tracker buffers no longer showed up as significant
memory contributors in heap profiles.

Changelog Message: PEM's can now limit the total memory used by Pixie's
socket tracer buffers through the `--total_conn_tracker_mem_usage`
command line flag or the `PX_TOTAL_CONN_TRACKER_MEM_USAGE` env var. This
allows memory conscious users to have more predictable memory use when
paired with `PL_TABLE_STORE_TABLE_SIZE_LIMIT`.

Signed-off-by: Dom Del Nano <[email protected]>
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.

2 participants