Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

c.Request.FormFile is ridiculously slow sometimes #1988

Closed
zhiqiangxu opened this issue Jul 12, 2019 · 7 comments
Closed

c.Request.FormFile is ridiculously slow sometimes #1988

zhiqiangxu opened this issue Jul 12, 2019 · 7 comments

Comments

@zhiqiangxu
Copy link

zhiqiangxu commented Jul 12, 2019

  • 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()
@zhiqiangxu zhiqiangxu changed the title c.Request.FormFile is ridiculously slow c.Request.FormFile is ridiculously slow sometimes Jul 12, 2019
@solarfly73
Copy link

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?

@zhiqiangxu
Copy link
Author

@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..

@zhl11b
Copy link

zhl11b commented Nov 6, 2019

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

@A-Kamaee
Copy link

A-Kamaee commented Mar 3, 2022

Same here. 👋🏼

@ben-swit
Copy link

i have same issue

@vishwaszadte
Copy link

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

@raghavcrofarm
Copy link

i am also facing the same has anyone find solution ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

8 participants