This page applies to an earlier version of the AppDynamics App IQ Platform.
See the latest version of the documentation.

Skip to end of metadata
Go to start of metadata

This topic describes how to configure multiple Node.js Agent on a machine to share a single, multi-tenant Java proxy.

About Proxy Sharing

Each Node.js agent on a machine normally launches its own proxy instance, having created the control directory for its proxy based on a unique combination of application, tier, and node name for the agent. The control directory contains the configuration for the agent as well as the domain control socket, which the agent uses to start an AppDynamics node.

If running multiple Node.js agents on a single machine, you can configure them to use a shared Java proxy. A shared proxy (also called multi-tenant proxy) reduces the overhead of additional proxies. 

A shared proxy is required configuration if you use an external process manager, such as PM2. 

Configure a Shared Proxy

  1. Stop the Node.js application.
  2. Create directories for the agent and the agent logs and for the proxy control directory. The permissions on this directory must be readable and executable by the application user that the application and writable by the proxy user. For example:

    mkdir /tmp/appd /tmp/appd/logs /tmp/appd/proxy_ctrl_dir

    You may want to devise a technique for creating these directories automatically whenever you upgrade the Node.js agent.

  3. Disable automatic proxy launching for each agent. In the AppDynamics require.profile() block, set proxyAutolaunchDisabled to true and set the proxyCtrlDir to the directory that you created. For example:

    proxyAutolaunchDisabled: true,
    proxyCtrlDir: '/tmp/appd/proxy_ctrl_dir',
  4. Ensure that each agent that reports to the multi-tenant proxy is configured with a unique node name.

  5. Start the shared Java proxy before you start the agents, passing the agent control directory as the proxyCommunicationDir argument to the runproxy script. See Run the Node.js Proxy Daemon Manually. AppDynamics recommends that you configure the proxy to start on system startup.
  6. Restart the Node.js application. In a few minutes, the nodes should appear in the Controller UI flow maps.

Proxy Sharing Limits

In its default configuration, a single proxy can handle up to ten agents. If you need to run more, you will likely need to adjust the maxHeapSize and maxPermSize settings in the runproxy script.

When adding agents, use debug mode and monitor the proxy.out file, which indicates whether the proxy is running out of heap. The file is visible when running in debug mode.