Skip to content

My Dagster code is hanging or taking longer than I expect to execute. How can I troubleshoot? #14771

Discussion options

You must be logged in to vote

We recommend that you use py-spy to profile your code.

For hanging code, py-spy dump can give you a dump of each thread, which usually makes it immediately clear where the hang is happening.

For slow code, py-spy record can produce an SVG file that gives you a flame graph of where the process is spending the most time. (We recommend py-spy record -f speedscope --idle to produce speedscope profiles, and to include idle CPU time in the results)

Note that py-spy usually requires elevated permissions in order to run.

--

A typical workflow for generating a py-spy dump for a hanging run in Kubernetes:

a) Set up your Dagster deployment so that each run pod is using a security context that can ru…

Replies: 3 comments 7 replies

Comment options

gibsondan
Jun 13, 2023
Maintainer Author

You must be logged in to vote
1 reply
@abi-mutinex
Comment options

Answer selected by gibsondan
Comment options

You must be logged in to vote
1 reply
@gibsondan
Comment options

gibsondan Jun 16, 2023
Maintainer Author

Comment options

You must be logged in to vote
5 replies
@gibsondan
Comment options

gibsondan Oct 28, 2024
Maintainer Author

@gibsondan
Comment options

gibsondan Oct 28, 2024
Maintainer Author

@yamhirotoCS
Comment options

@gibsondan
Comment options

gibsondan Oct 28, 2024
Maintainer Author

@yamhirotoCS
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: troubleshooting Related to debugging and error messages
4 participants