1

our application return huge json data ,but if the response size is getter than 850 mb approx we are getting Http 500 error.I did tried to find the solution , here are some link which I have look at.

https://serverfault.com/questions/514927/file-uploads-and-client-max-body-size-in-nginx-gunicorn-django nginx - client_max_body_size has no effect ngnix + gunicorn throws truncated response body

setting client_max_body_size to some value seems to be possible solution for this.

But I am not able to figure it out how to write this in startup command

My startup command is

gunicorn --bind=0.0.0.0 --workers=4  --timeout=3000 app:app

My application is in Flask hosted in Azure web app service

qaiser
  • 2,770
  • 2
  • 17
  • 29
  • Has your problem been solved? Is there any progress? – Jason Pan Nov 12 '20 at 08:14
  • @JasonPan sorry for my late reply , our client application is different reporting tool , so far we are able to get a response of 2.3 GB through flask streaming . – qaiser Nov 12 '20 at 13:42
  • our API endpoint is giving json data – qaiser Nov 12 '20 at 13:42
  • It is recommended to write another program to store and process 2.3GB of json data. A client request returns such big data. If the customer base is very large, do you think the program design is reasonable? – Jason Pan Nov 13 '20 at 02:48

1 Answers1

0

The setting of client_max_body_size is to solve the error of uploading files that are too large. The general error code is 413.

So I think the solution of configuring client_max_body_size cannot solve your problem.

Do you think it is normal for response json data in webapp to exceed 100M? Besides, your data may exceed 850M. The pressure that the azure webapp server can withstand, are you sure that the client's browser is also OK?

You can refer to this article(HOW BIG IS TOO BIG FOR JSON?. The author tested the impact of the size of the returned json data on the browser, which should be very helpful to you.

Suggestion:

1. Use paging reasonably to filter data and return useful data.

2. In the sql script, only return the necessary fields.

Jason Pan
  • 15,263
  • 1
  • 14
  • 29