cloudflare / quiche

🥧 Savoury implementation of the QUIC transport protocol and HTTP/3
https://docs.quic.tech/quiche/
BSD 2-Clause "Simplified" License
9.41k stars 709 forks source link

some questions about the flamegraph of quiche-server #1356

Open yejingx opened 1 year ago

yejingx commented 1 year ago

When I tested quic-server, I found that a lot of time was spent in quiche::h3::qpack::huffman::Decoder::decode4. Why are so many memcpys generated here?

image

Suldeaked commented 1 year ago

i don't know try to find out what is going on

On Tue, Oct 25, 2022, 10:10 AM yejingx @.***> wrote:

When I tested quic-server, I found that a lot of time was spent in quiche::h3::qpack::huffman::Decoder::decode4. Why are so many memcpys generated here?

[image: image] https://user-images.githubusercontent.com/2890050/197733440-00202863-8fec-4106-8fd3-5873328ccd1c.png

— Reply to this email directly, view it on GitHub https://github.com/cloudflare/quiche/issues/1356, or unsubscribe https://github.com/notifications/unsubscribe-auth/AZTRT324LX2KWCQRO7IFTW3WE6PZTANCNFSM6AAAAAARNYHEEU . You are receiving this because you are subscribed to this thread.Message ID: @.***>

LPardue commented 1 year ago

@yejingx can you provide any more information about your setup please? What is the client, what headers are being sent to the server, have you got a pcap with decryption keys that you can share?

yejingx commented 1 year ago

@LPardue the setup:

  1. cargo build to build the master branch
  2. run quiche-server with default parameters image
  3. test the server with h2load
    h2load --npn-list h3 -D 100 -c 100 -t 4 https://127.0.0.1:4433/hello
  4. Start flamegraph to collect the profile of quiche-server
    flamegraph --pid 3419385

    3419385 is the pid of the running quiche-server.

here is the generated flamegraph: 4

and the result of h2load: image

The reason why all requests failed is that the path /hello is 404

LPardue commented 1 year ago

Thank you for the detailed reproduction steps. This will help us investigate.

yejingx commented 1 year ago

@LPardue Have you reproduced it? The flame graph is really weird, I don't know if it's a bug of quiche-server or something is wrong with the flamegraph tool.

junhochoi commented 1 year ago

All h2load requests are failing - you need to fix it first. After that, please try with a release build.

yejingx commented 1 year ago

@junhochoi As I mentioned above, all h2load requests failed because of the path /hello is not exist.

I retried with an existing /hello path, all requests are 200 now(also, I don't think it should be so even if all the requests fail). The result is shown below:

image image 15

The commands to reproduce:

  1. run the server

    flamegraph -- ../target/debug/quiche-server --root <root path>
  2. start h2load

    h2load --npn-list h3 -D 20 -c 1 -t 1 -m 1 https://127.0.0.1:4433/hello

The version I used to test is 0.16.0