Slow transfers in Jetty with chunked transfer encoding at certain buffer size

后端 未结 3 1709
忘了有多久
忘了有多久 2021-02-07 05:47

I\'m investigating a performance problem with Jetty 6.1.26. Jetty appears to use Transfer-Encoding: chunked, and depending on the buffer size used, this can be very

3条回答
  •  无人共我
    2021-02-07 06:21

    Yes, Jetty will default to Transfer-Encoding: Chunked if the size of response cannot be determined.

    If you know the size of response that what its going to be. You need to call resp.setContentLength(135*1000*1000*1000); in this case instead of

    resp.setBufferSize();

    actually setting resp.setBufferSize is immaterial.

    Before opening the OutputStream, that is before this line: OutputStream outStream = resp.getOutputStream(); you need to call resp.setContentLength(135*1000*1000*1000);

    (the line above)

    Give it a spin. see if that works. Those are my guesses from theory.

提交回复
热议问题