kolofordjango / kolo

See everything happening in your running Django app. All without leaving VSCode
https://kolo.app
504 stars 14 forks source link

Error: crash of subprocess when clicking "Visualization" on a large request #72

Open corentinbettiol opened 1 year ago

corentinbettiol commented 1 year ago

Here's a screenshot of the request I'm trying to analyze:

image

When I click on "Visualize", nothing happens for a long time. The same thing happens when I click the "Frames (76924)" button: my cpu start burning and after one or two minutes an empty grey window appears:

image

Waited like 10 mins for something to happen, but there was nothing.

wilhelmklopp commented 1 year ago

👋 @corentinbettiol welcome and thanks for the report(s)!

As you've discovered, kolo isn't quite yet capable of handling very large traces (more than 10k frames). Definitely something we hope to support in the future, but yeah we're not there yet.

For now, all I can recommend is to reduce the size of the trace kolo captures using the ignore_frames setting https://docs.kolo.app/en/latest/config.html#ignore-frames

corentinbettiol commented 1 year ago

Hi, thanks for the explanation :)

Could you specify somewhere that kolo can't handle large traces?

I tried it specifically because this page is so big that I can't really understand what's going on, and I hoped kolo could help me see what was slow and where.

wilhelmklopp commented 1 year ago

I tried it specifically because this page is so big that I can't really understand what's going on, and I hoped kolo could help me see what was slow and where.

yep completely understand! And being able to make sense of big, complex code is really the whole point of kolo, so it should really be able to help you with this haha 😬 – I'll have a look today if there are some quick wins to make the visualisation/frame list load for a large number of frames.

In the mean time, if you're feeling adventurous and want to get an overview of what gets called in the code, have a look at "open compact tree structure" and "open raw trace"

image

Actually, could you let me know if "open compact tree structure" works for you on the 76k trace? That will be a helpful data point, thanks!

corentinbettiol commented 1 year ago

@wilhelmklopp I tried to open the raw trace and was greeted by this error:

Error running command kolo.openRawTrace: cannot open kolo:trc_01HA753CN72XKHVRZ4RNQVSR90/raw/Raw%20trace%20GET%20/my/url/.
Detail: Files above 50MB cannot be synchronized with extensions..
This is likely caused by the extension that contributes kolo.openRawTrace.

Same error for open tree structure json.

Compact tree structure succeeded to open, and it was only 114k lines long :)

A click on visualization took up to 5-6Gb ram, then when the gray window appeared it released it all.

I tried some other pages on this website, they worked pretty well:

image

But there were some problems when hovering the dots (the popup did not appear, I had to find the request in the flamegraph and hover this one instead).