var pm2 = require('pm2');
pm2.connect(function() {
  pm2.start({
    name: 'server',
    script: 'server/production-start.js',
    'exec_mode': 'cluster',
    instances: '2',
    'max_memory_restart': '900M'
  }, function() {
    pm2.disconnect();
  });
});

@@ -67,16 +67,43 @@
    name:
+ process.env.SERVER_NAME %7C%7C
  'server
@@ -101,24 +101,24 @@
 %7C 'server',%0A
-
     script: 
@@ -194,11 +194,34 @@
 es: 
-'2'
+process.env.INSTANCES %7C%7C 1
 ,%0A  
@@ -247,15 +247,108 @@
 rt':
+%0A      (process.env.MAX_MEMORY / process.env.INSTANCES %7C%7C 1) %7C%7C
  '
-9
+3
 00M'
+,%0A    'NODE_ENV': 'production'
 %0A  %7D

add environmental vars to pm2start instead of hardcoding