Welcome, Guest Login

Public Cloud Center

Graceful Shutdowns

Last Updated: Apr 19, 2017 10:18AM EDT

All Xervo projects receive notifications prior to something happening to them. This provides time for your application to gracefully react before an application is stopped, restarted, deployed, or any other action.


Notifications are sent via HTTP POST. Applications must listen on port 63002 to receive these notifications.

Port: 63002
Method: POST
Route: /


Once the message has been sent applications have up to 30 seconds before the action occurs. Applications can respond or end the graceful shutdown request sooner than 30 seconds to indicate they are done and allow Xervo to immediately complete the action.

Data Format

Data is posted as JSON with the following format:

{ "action": "[string]" }


"stop" User has stopped their application. Also sent to instances that will be removed during a scale down.
"restart" User has restarted their application.
"deploy" User has deployed a new version of their application.


Below is a simple implementation of a graceful shutdown server using Express 4.

var express = require('express');
var bodyParser = require('body-parser');
var shutdownApp = express();


shutdownApp.post('/', function(req, res) {
  // Do whatever cleanup is required and end the request when done.
  // Using setTimeout here to simulate an async cleanup operation.
  setTimeout(function() {
  }, 5000);

// Listen on the graceful shutdown port.


It's important not to exit your own process during one of these events. Our system will send the kill signal to your process at the appropriate time. If you kill your own process, it will be treated like a crash, brought back, and then killed again after the graceful shutdown notification is complete.

Go to top

Contact Us

    Our Support Policy
    Submit a Support Request

  • Public Cloud Support Hours
    9am-5pm EST Mon-Fri
    Outside of these hours response times may be up to 24hrs.

    Submit a support ticket by clicking 'status and support' icon on the left side of this page.

seconds ago
a minute ago
minutes ago
an hour ago
hours ago
a day ago
days ago
Invalid characters found