I think this is probably super vague, but are ther...
# ask-metaflow
p
I think this is probably super vague, but are there any guidelines or best practices on troubleshooting long running times? In short, i have a piece of python code, that queries database, calculates a bunch of different statistics and outputs the dataframe to a file. On average it takes around 3 mintues to execute. I translated it into metaflow step, without any changes to the code and i call it the same way in metaflow as I would do as a standalone and it takes more than 20 minutes. How should i approach the troubleshooting of the main difference between those two executions? They are both executed on local machine.
1
b
some possible approaches: • first a question on your local Metaflow setup. Are you running a local datastore or using a remote one? This can result in slower execution if you are persisting large artifacts as part of the processing (assigning them to
self.some_artifact
in the steps) ◦ running the flow code with
--datastore local --metadata local
options should by all means result in similar performance as running your code natively For the debugging part, any code inside your steps you should be able to debug in the same way as any regular Python. The logs are also timestamped so that should give some clues as to whether the delays are in step code or in the housekeeping that is happening between them. A more involved approach: To gain insights on Metaflow internals you could try poking at the provided opentelemetry implementation with f.ex. the console logger:
Copy code
METAFLOW_CONSOLE_TRACE_ENABLED=1 python helloflow.py --metadata local --datastore local run
this will require some libraries locally,
opentelemetry-sdk, opentelemetry-api
at least. In order to surface dependency errors you can run with the
METAFLOW_DEBUG_TRACING=1
flag
p
Appreciate it @bulky-afternoon-92433, will follow your suggestions and report back! Thanks!