Process enormous size Request Body in restful api

32 Views Asked by At

I got an requirements to process large size content in post request.

At first, i implement this in normal way

  • receive json array as request body
  • execute business logic while traversing the array

But my co-worker pointed out that your implementation can cause oom kill. so, it would be better to receive file or process json array with stream (not json array).

However, whether you receive a file or a json array, the capacity is the same, but isn't the burden on memory the same? What causes oom kill in the api server? I guess that the moment i assign large-sized data to a variable, it can cause oom kill.

i'll appreciate that if you could let me know how can i avoid oom and what causes oom

0

There are 0 best solutions below