• go version: go1.10
  • gin version (or commit ref): v1.4.0
  • operating system: linux

Description

c.Request.FormFile is ridiculously slow, sometimes takes 26s for uploaded image(~600k)

Screenshots

Here's the related log:

Upload api took 26.27741246s size 637445 FormFile took 26.067774073s

Here's the code snippet that generates the FormFile took part:

    start := time.Now()
    file, header, err := c.Request.FormFile("stuff")
    start2 := time.Now()
    log := "FormFile took " + start2.Sub(start).String()

Comment From: solarfly73

Is that running on a compute instance? What's the system configuration, is /tmp memory or ssd backed? Is this before the multipart change to byte array/blob upload?

Comment From: zhiqiangxu

@solarfly73 ,it's running on an aliyun ecs instance, 8C16G, /tmp is backed by ssd. I don't understand your last question:(

Now I suspect it's related to the tcp congestion window, still investigating..

Comment From: zhl11b

I hava same situation,do you solve it?@zhiqiangxu

Comment From: A-Kamaee

Same here. 👋🏼

Comment From: ben-swit

i have same issue

Comment From: vishwaszadte

@ben-swit how were you able to solve this? I'm currently facing the same issue

Comment From: raghavcrofarm

i am also facing the same has anyone find solution ?