File upload speed is slow

Hi I implemented file upload with storeUploadedFile with the following code. I have an internet with upload speed about 16Mbps, but it always takes me about 1 minute to upload a 15 MB file. It is always about a minute when I saw the logger output ‘received file xx’. Is there any settings in akka http to speed it up? Or what are the relevant settings I can try with?

(post & path( Segment/ "upload")
      & withNoCache
      & withSizeLimit(MAX_CONTENT_SIZE)
      ) { (
        storeUploadedFile("user_file", tempDestination) {
            case (metadata, file) =>
      "received file ${metadata.fileName}")

Thanks in advance,

Hi @weicheng113,

really hard to say where the bottleneck is in such a case.

You could try to capture traffic with wireshark / tcpdump and then see if it’s throttled by congestion window (bottleneck = upload line) or by receive window (bottleneck = server) or by the client itself. Feel free to attach such a dump here so we’d could have a quick look if anything stands out.


@jrudolph Thanks Johannes for the prompt reply.

There is no problem when I test it locally(running the file receiving service app locally and upload file to it). It is currently runing inside a kubernates pod in AWS EKS. I will try to do tcpdump next Monday and get you back. By the way, are there relevant logging options I can turn on to get some more information on the issue?

You could try to enable debug logging but it might be too verbose.

@jrudolph I did two 15MB file uploads. The attached is the tcpdump file, which is 16MB after gz compression. It seems I can’t upload it. Maybe it is too big. I took a screenshot of part of it, which may be what you want?

@jrudolph I tried port-forwarding into the pod and upload file directly. I tried uploading a file of 15MB 3 times and it took 15 seconds, 13 seconds and 14 seconds. It looks to me that this can roughly match with my upload speed(about 16Mbps -> 2MB per second). So the problem may be in our AWS networking configuration. Thanks for your time.