Keep Confluence Windows Service running 24/7 with Service Protector

How to Keep the Confluence Windows Service Running 24/7 with Service Protector

Automatically restart Confluence when it stops for any reason. Survive, crashes, memory leaks, non-responsive web pages and more.

Confluence is a java-based team collaboration package. It normally installs itself as a Windows Service, to start immediately when the server boots and run unattended in the background in a 24x7 environment:

To protect the Confluence Windows Service with Service Protector:

  1. Download and install Service Protector, if necessary.

  2. Start Service Protector.

  3. Select Protector > Add to open the Add Protector window:

    Add Protector

  4. On the General tab, in the Service to protect field, select the Confluence windows service. It will be called Atlassian Confluence.

    You will notice a green circle beside the name if the service is already running (as was the case on our PC).

    Confluence Windows Service: General Tab

  5. If you find that Confluence occasionally crashes or hangs, click over to the Monitor tab where we will set up a failure detection script to tell Service Protector when it should restart Confluence.

    1. Follow these instructions to create the failure detection BAT file. We have called ours check-confluence.bat and placed it in the Confluence installation folder (C:\Program Files\Atlassian\Confluence\bin).

    2. Check the Whenever it fails a "sanity check" box. Click the ... button and specify the full path to the batch file you created.

    3. Specify how often to check. We recommend every 5 minutes, but you can check more or less frequently depending on your situation (and how much downtime you can afford).

    And if you find that Confluence accumulates memory and gets slower over time, we recommend that you periodically restart the service at a time when no one is likely to be using the server. To do so:

    1. Check the At the following times box.

    2. Click the Add button.

    3. Specify the day and time to restart the service. We have chosen every day at 2 AM. Note that you can choose to reboot the server at that time if you like.

    4. Click the OK button to record the time.

    Confluence Windows Service: Monitor Tab

  6. Click the Save button. In a few seconds, an entry for Atlassian Confluence will show up in the Service Protector window. The Confluence windows service is probably already running but it is not yet being protected by Service Protector.

    Confluence Windows Service: Created

    Click on the green circle to see details of the Confluence service. (It sure uses a lot of memory!)

    Confluence Windows Service: Details

  7. To start monitoring Confluence, choose Protector > Start "Atlassian Confluence". In a couple of seconds the shield icon in the Protected column will go to green to indicate that Confluence is being managed by Service Protector:

    Confluence Windows Service: Protected

  8. That's it! Next time your computer boots, Confluence will start up automatically (as normal) and Service Protector will start monitoring the service to quickly restart it if it stops for any reason.

    We encourage you to edit the Confluence entry in Service Protector and check out the many other settings that may be beneficial to your environment. For example, send an email when the service fails, watch out for the service getting stuck starting or stopping, and much more.

Trouble protecting the Confluence Windows Service?