My FeedDiscussionsHeadless CMS
New
Sign in
Log inSign up
Learn more about Hashnode Headless CMSHashnode Headless CMS
Collaborate seamlessly with Hashnode Headless CMS for Enterprise.
Upgrade ✨Learn more
NodeJS performance issue while running it as reverse proxy.

NodeJS performance issue while running it as reverse proxy.

Ujjwal Kanth's photo
Ujjwal Kanth
·Apr 11, 2016

I am using a simple express application as reverse proxy. The job of this application is to route downstream calls to otherAPI endpoints.

The issue I am noticing is, node-proxy is adding 5-10 times the time the downstream application is taking. For example: if downstream application is taking 30 ms, final response time is nearly 250 ms.

Apart from the network response taking lot longer, these are a few observations.

  1. There are sudden spikes in response times which I can't co-relate to any other metric. i.e. CPU usage or Memory Usage etc.
  2. There are times where entire node application freezes. Could possibly be due to garbage collection, but I am not sure how to debug it.

Is there any particular reason that comes to your mind for such a scenario?

PS: I won't be able to share code, but will answer all questions. Can also share some snippets.