High CPU usage if request content is bytes #2567
Replies: 1 comment
-
|
@kice For reference, the code for sending POST data bytes lives here: Line 107 in 2880c08 As you can see, the code path is different between In the first case, the entire 10MB body is sent through in one go. On the other hand, it is sent through in chunks of 64 kB via [ Line 42 in 2880c08 The actual "sending" happens in It could be that the treatment of a huge 10 MB chunk by any part of the networking stack (h11, To confirm, it would be interesting to compare CPU usage on your machine with some sample code sending 10 MB random data with each method. Are you able to replicate a bump? (I am moving this to a discussion for now.) |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
I noticed a increase of CPU usage after I changed request content from
content=io.BytesIO(b'<actual data>')tocontent=b'<actual data>'. The content I want to send is 10MB in size, which is not that much, but still considerable amount of data.My code is running on a VPS with low end CPU, which makes it much more dramatic (from peek at 40% to pinned at 100%).
I would like to help debug this issue, but I need some instructions to do so.
Beta Was this translation helpful? Give feedback.
All reactions