Keep Memurai running 24/7 with Service Protector

How to Keep Memurai Running 24/7 with Service Protector

Automatically restart the Memurai Windows Service if it crashes or is accidentally shut down. Ensure that your cache/datastore is always available, with zero downtime.

Memurai is Redis-compatible cache and datastore specifically tailored for Windows. It can be installed as a Windows Service, so that it starts automatically at boot:

To keep the Memurai server up and running with Service Protector:

  1. If necessary, install Memurai.

    We recommend choosing the default service option:

    If not, you should manually install the service following these instructions.

  2. Download and install Service Protector, if necessary.

  3. Start Service Protector.

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

    Add Protector

  5. On the General tab, select the Memurai service from the Service to protect list. You will notice a green circle on the left if the service is already running.

    Memurai Windows Service: General Tab

  6. Are you worried about Memurai hanging or failing? If so, you should set up a periodic check of the Memurai HTTP port — to quickly restart the server if it ever stops serving web requests.

    To do so, move to the Monitor tab and:

    1. Check the Whenever it fails a sanity check box and click the "..." button to the right.

    2. In the Configure Sanity Check window that comes up, enter the following command:

      "C:\Program Files (x86)\ServiceProtector\SanityCheck\ConnectToSocketSanityCheck.exe" localhost 6379
      Be sure to adjust the port number if you have overridden Memurai's default of 6379.

    3. Change the Every controls to 5 minutes. Feel free to reduce that period if you want to check for a failure more frequently.

      Configure Memurai Sanity Check

    4. Click the OK button to close the Configure Sanity Check window and return to the main configuration.

    Memurai Windows Service: Monitor Tab

  7. We're done configuring Memurai so click the Save button to record your settings. In a couple of seconds, an entry for Memurai will appear in the Service Protector window.

    The shield icon will be green, indicating that Service Protector is already monitoring the Memurai server:

    Memurai Windows Service: Created

  8. That's it! Next time your computer boots, Memurai will start as normal and Service Protector will begin monitoring the service to promptly restart it if it fails, crashes or stops for any reason.

    We encourage you to edit your Memurai entry in Service Protector and review the many other settings that could help in your environment. For example, send an email when the service fails, restart Memurai regularly to keep the service responsive, and much more.

Trouble protecting the Memurai Windows Service?