Debugging, logging, monitoring and performance tuning of Edge node.js proxies

2 0 2,290

In response to a consulting request from a customer, I recently collated a list of links related to debugging, logging, monitoring and performance tuning for Apigee Edge node.js proxies. These links are mostly from Apigee Community and Apigee documentation along with a few public links as well. Thought of consolidating these into a short article for easy reference.

Node.js runtime: Apigee Edge uses Trireme to run node.js components in a JVM. A detailed overview of Trireme including differences with regular node.js and limitations is available at https://github.com/apigee/trireme

Debugging: This link http://docs.apigee.com/api-services/content/debugging-nodejs-proxies explains the basics and best practices for debugging node.js components in Apigee Edge. It covers node.js logs feature and debugging using console.log and the Apigee Edge trace tool. The link http://docs.apigee.com/management/apis/get/o/%7Borg_name%7D/e/%7Benv_name%7D/apis/%7Bapi_name%7D/cac... provides the Apigee management API call to automate retrieval of node.js logs from the Apigee Edge platform.https://www.npmjs.com/package/debug is a small debugging utility that can be used with on-premises deployments.

The video http://techblog.netflix.com/2015/12/debugging-nodejs-in-production.html provides an in-depth insight into debugging node.js applications in production and covers topics such as analyzing latency using Restify, using Linux Perf Events to sample stack traces of running processes in production, using FlameGraphs to analyze stack trace samples to identify poorly performing code, capturing core dumps on crashes, analyzing core dumps using mdb to narrow down to source code causing crashes, using gcore to analyze memory leaks and leaking objects. https://github.com/nodejs/post-mortem, https://github.com/joyent/mdb_v8 and https://github.com/indutny/llnode are useful links covering debugging of running node.js production processes.

Logging and monitoring: The community article https://community.apigee.com/articles/3352/api-log-management-push-model.html explains how to push logs from node.js components running on Apigee Edge to tools such as Loggly and Splunk for monitoring. http://docs.apigee.com/api-services/reference/message-logging-policy explains logging from Apigee API proxies to files on the file system and syslog servers.

Performance tuning : The community post https://community.apigee.com/articles/6490/nodejs-performance-tips-socket-pooling.html explains a simple setting that can give significant performance impovements if there are many concurrent outgoing requests to the same host.

Version history
Last update:
‎10-13-2016 09:13 PM
Updated by: