Skip to content

json parser taking close to 60 seconds during transaction #243

@justinpage

Description

@justinpage

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:

screen shot 2017-05-08 at 9 30 07 am

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!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions