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.
- 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.
- 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.