Skip to content

Conversation

COLDTURNIP
Copy link
Contributor

Which issue(s) this PR fixes:

Issue longhorn/longhorn#11386

What this PR does / why we need it:

Special notes for your reviewer:

Additional documentation or context

@COLDTURNIP COLDTURNIP self-assigned this Jul 28, 2025
@COLDTURNIP COLDTURNIP requested a review from a team as a code owner July 28, 2025 09:24
@github-actions github-actions bot requested a review from jhkrug July 28, 2025 09:24
Copy link

netlify bot commented Jul 28, 2025

Deploy Preview for longhornio ready!

Name Link
🔨 Latest commit 1be89be
🔍 Latest deploy log https://app.netlify.com/projects/longhornio/deploys/689944c8a9eb6f000876ecd0
😎 Deploy Preview https://deploy-preview-1166--longhornio.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

Copy link
Contributor

@sushant-suse sushant-suse left a comment

Choose a reason for hiding this comment

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

Some suggestions for your consideration.
Thanks.

Comment on lines 82 to 86
### Engine, replica, and sync agent runtime

Pprof server can be enabled dynamically for runtime profiling.

To enable profiling, shell into the instance manager pod, and check the port of the runtime using `ps`:
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
### Engine, replica, and sync agent runtime
Pprof server can be enabled dynamically for runtime profiling.
To enable profiling, shell into the instance manager pod, and check the port of the runtime using `ps`:
### Engine, Replica, and Sync Agent Runtime
You can enable the `pprof` server dynamically to perform runtime profiling.
To enable profiling, you can:
1. Shell into the instance manager pod.
2. Identify the runtime process and its port using `ps`:

--replica tcp://10.42.1.7:10000 --listen 0.0.0.0:10010
```

And assign a port to enable the pprof server for given runtime process:
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
And assign a port to enable the pprof server for given runtime process:
3. Enable the `pprof` server for the desired runtime (for example, sync-agent):
> In this example, the sync-agent process listens on port `10002`.

Comment on lines 108 to 110
The pprof server of sync agent (serves at port `10002`) is available at `http://localhost:36060` inside the instance manager pod in the example. Refer to the [pprof official document](https://pkg.go.dev/net/http/pprof#hdr-Usage_examples) for the profiler usage.

The profiler can be disabled after profiling.
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
The pprof server of sync agent (serves at port `10002`) is available at `http://localhost:36060` inside the instance manager pod in the example. Refer to the [pprof official document](https://pkg.go.dev/net/http/pprof#hdr-Usage_examples) for the profiler usage.
The profiler can be disabled after profiling.
> The `pprof` server is now accessible at `http://localhost:36060` *inside the instance manager pod*.
4. Use the `pprof` interface for runtime inspection. For more details, refer to the [official pprof documentation](https://pkg.go.dev/net/http/pprof#hdr-Usage_examples).
5. Disable the profiler after completing your analysis:

@COLDTURNIP COLDTURNIP force-pushed the 11386-sync_agent_pprof branch from 10b8cde to 0abe0a9 Compare August 5, 2025 03:45
@COLDTURNIP COLDTURNIP requested a review from sushant-suse August 5, 2025 03:50
longhorn-11386

Signed-off-by: Raphanus Lo <[email protected]>
@derekbit derekbit force-pushed the 11386-sync_agent_pprof branch from 0abe0a9 to 1be89be Compare August 11, 2025 01:17
@derekbit derekbit merged commit 4ab5e9f into longhorn:master Aug 11, 2025
5 of 6 checks passed
@COLDTURNIP COLDTURNIP deleted the 11386-sync_agent_pprof branch August 12, 2025 11:04
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