# Application high response time with Nodejs agent

**URL:** <https://discuss.elastic.co/t/application-high-response-time-with-nodejs-agent/213101>\
**Category:** APM\
**Tags:** nodejs\
**Created:** [December 26, 2019, 4:25pm UTC](https://discuss.elastic.co/t/application-high-response-time-with-nodejs-agent/213101 "2019-12-26T16:25:56Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![vicmerlis](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/vicmerlis/32/50887_2.png) [@vicmerlis](https://discuss.elastic.co/u/vicmerlis)\
**Post date:** [December 26, 2019, 4:25pm UTC](https://discuss.elastic.co/t/application-high-response-time-with-nodejs-agent/213101/1 "2019-12-26T16:25:57Z")

</div>

**Kibana version** : 7.5.1

**Elasticsearch version** : 7.5.1

**APM Server version** : 7.5.1

**APM Agent language and version** : Nodejs. "elastic-apm-node": "^3.3.0"

**Original install method (e.g. download page, yum, deb, from source, etc.) and version**:  
Elasticsearch Cluster: yum  
APM Server: Docker image - [docker.elastic.co/apm/apm-server:7.5.1](http://docker.elastic.co/apm/apm-server:7.5.1)  
Kibana: Docker Image: kibana:7.5.1

**Fresh install or upgraded from other version?** Fresh install

**Is there anything special in your setup?** For example, are you using the Logstash or Kafka outputs? Are you using a load balancer in front of the APM Servers? Have you changed index pattern, generated custom templates, changed agent configuration etc.

- Using load balancer in front APM server
- Agent configuration:  
require('elastic-apm-node').start({  
serviceName: "capping",  
serverUrl: `${config.apm.protocol}://${config.apm.host}:${config.apm.port}`,  
active: config.apm.enabled,  
transactionSampleRate: config.apm.transaction\_sample\_rate, // set to 0.2  
transactionMaxSpans: config.apm.transaction\_max\_spans, // set to 50  
ignoreUrls: config.apm.ignore\_urls // ignore problematic routes  
});

**Description of the problem including expected versus actual behavior. Please include screenshots (if relevant)**:  
We experiencing a higher response time than usual when using APM, we found the reason of the high response time. it is happening because of one of the application routes. when we are excluding that route from being sent to APM server the response time become as usual.

Info about the problematic route:

- Average latency ~26s/m
- 95th Percentile ~64s/m
- About 1 request per minute

Screenshots of the application response time running the same code under same load:

 ![capping-response-time-temp](https://us1.discourse-cdn.com/elastic/original/3X/f/a/fa99750cf46b562f2a093e9e6b8ea3909e9302ad.png) ![capping-response-time-apm](https://us1.discourse-cdn.com/elastic/original/3X/b/b/bb1daa77273c41ddf523a7b16ea33f897cfbddec.png)

- We already tried to reduce transactionSampleRate to 5% and Reduced transactionMaxSpans to 50, not helped 😑  
any idea why that specific route causes to a higher response time of the application?

Thanks,  
Vic M.

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [January 16, 2020, 12:26pm UTC](https://discuss.elastic.co/t/application-high-response-time-with-nodejs-agent/213101/2 "2020-01-16T12:26:00Z")

</div>

This topic was automatically closed 20 days after the last reply. New replies are no longer allowed.
