What values available in node.js combined create a unique ID for each process on each server in node.js? Right now, I only know how to obtain the process id.
node.js is a single-threaded server. It will only use one CPU core (spawned processes can use other cores) and process.pid
would suffice for identifying the node process on system. If you run multiple node.js servers, then each will have different process.pid.
If you want a single node server to take advantage of multi-core CPU, you must run node.js in cluster. Use cluster
package http://nodejs.org/api/cluster.html.
It forks main thread into a number of worker threads, which communicate with each other using IPC (Inter-Process Communication). Each worker utilizes a CPU core. To get id for each worker you can use worker.id
http://nodejs.org/api/cluster.html#cluster_worker_id
Edit: Adding from comment
The answer depends on the size / range of possible values. On a LAN hostname, IP and pid may be enough. Also each server can have multiple NIC and IP it can listen to. Check this using app.address() { address: '192.1.168.5', family: 'IPv4', port: 3000 }