Problem
Throughout the day we are seeing close to 60 second transaction calls from mobile app devices to our API. We've noticed in our new relic that the bottleneck appears to be the json parser middleware:

Looking at our code, we are simply adding the following package as a middleware to some of our available routes:
export const jsonParser = bodyParser.json({
limit: "5mb"
});
We've identified that our apps seem to trigger this issue the most.
Reproducing
Sending the wrong content-length size in the header seems to reproduce the issue. We have a theory that the apps are calculating the content length automatically but are sending the wrong size.
Question
Is there any work around to this bottleneck issue? Something we can do in regards to not always expecting the correct content-length size? Or perhaps some max timeout limit in awaiting more data to come in? We noticed this issue mentioned a few years back that might be related?
https://github.com/stream-utils/raw-body/issues/32
Thanks!
Problem
Throughout the day we are seeing close to 60 second transaction calls from mobile app devices to our API. We've noticed in our new relic that the bottleneck appears to be the json parser middleware:
Looking at our code, we are simply adding the following package as a middleware to some of our available routes:
We've identified that our apps seem to trigger this issue the most.
Reproducing
Sending the wrong content-length size in the header seems to reproduce the issue. We have a theory that the apps are calculating the content length automatically but are sending the wrong size.
Question
Is there any work around to this bottleneck issue? Something we can do in regards to not always expecting the correct content-length size? Or perhaps some max timeout limit in awaiting more data to come in? We noticed this issue mentioned a few years back that might be related?
https://github.com/stream-utils/raw-body/issues/32
Thanks!