-
Notifications
You must be signed in to change notification settings - Fork 3.8k
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
roachtest: add the option to enable continuous (cpu) profiling #135972
Comments
cc @cockroachdb/test-eng |
This issue has multiple T-eam labels. Please make sure it only has one, or else issue synchronization will not work correctly. 🦉 Hoot! I am a Blathers, a bot for CockroachDB. My owner is dev-inf. |
ExamplesNote, at this time I'm finding three existing roachtests which enable cpu profiles,
E.g., in NOTE: NOTE: the default sampling interval is 10 seconds (see Possible WorkaroundThe following pseudocode could be inserted right before a given roachtest is executed [4].
NOTE: when using a multi-tenant setup, we'd probably need to replace the first statement with,
[1] cockroach/pkg/cmd/roachtest/tests/kv.go Line 537 in 5c5c9d6
[2] https://teamcity.cockroachdb.com/repository/download/Cockroach_Nightlies_RoachtestNightlyGceBazel/17734111:id/kv/gracefuldraining/cpu_arch%3Darm64/run_1/artifacts.zip!/logs/1.unredacted/pprof_dump/cpuprof.2024-11-13T12_01_54.544.23.pprof [3] cockroach/pkg/server/env_sampler.go Line 52 in 5c5c9d6
[4] cockroach/pkg/cmd/roachtest/test_runner.go Line 1314 in 5c5c9d6
|
Cluster-wide automatic cpu profiling can be enabled via cluster setting [1]. There are multiple use-cases, including (manual) performance debugging, and profile-guided optimization [2].
Ideally, this option could be enabled metamorphically for any (eligible) roachtest. However, at this time, we don't have a general mechanism for metamorphic cluster settings [3]. As a temporary workaround, we could (randomly) enable cpu profiling before a given test is executed (i.e.,
TestSpec.Run
). Additionally, we could consider adding a CLI option, e.g.,roachtest run --enable-cpu-profling ...
to force the corresponding cluster settings.[1] https://www.cockroachlabs.com/docs/stable/automatic-cpu-profiler
[2] https://go.dev/doc/pgo
[3] #105807
Jira issue: CRDB-44802
The text was updated successfully, but these errors were encountered: