Service not responsive but mmc says its running

Posted on 2014-08-25
Last Modified: 2014-08-25
I work in a casino and our back end system has a service that is prone to memory leaks.  So at random times this service will stop responding, but still reports as running in MMC.  I was wondering if there was a script or something of the like that would check the service and restart it if its not responding.  All I know how to do is check the state of the service.  Which doesn't yield the results that I need.  Any help would be greatly appreciated.
Question by:Infamous_Q
    LVL 14

    Expert Comment

    by:Brad Groux
    The easiest way would be to create a scheduled task utilizing a batch file.

    Bat file example:
    net stop <service name>
    net start <service name>

    Open in new window

    NOTE: If the service has a space in the name, you must put it in "quotes."
    LVL 2

    Author Comment

    I have a task that does this daily. the issue is that the service run the player loyalty systems.  Its the type of system that I can't have go down.  The start and stop process takes too long during our heavy usage times to have it restart during those periods.
    LVL 14

    Accepted Solution

    There really isn't a way to know if a service is "hung," so even with utilities like Service Hawk you are limited to a scheduled restart.

    You may be able to try the Restart-Service PowerShell Cmdlet, it may cycle the service faster than a net stop/start.

    Outside of that, you can throw more hardware at the program to compensate for the memory leak - but obviously the best scenario would be to optimize the app to alleviate the memory leak.
    LVL 3

    Expert Comment

    How often does it stop responding?  I would go to the vendor and ask to fix it immediately.  Sometimes it works.  If it hangs once a day or less, scheduled stop and restart at the best time for your business looks to me the only solution  unless you can run the service at another server while the problematic one is going down -- again, there may be conflicts on the network or front end side of the operations.  Such an important task and such low quality system!  I would bug the vendor, that is for sure.
    LVL 2

    Author Closing Comment

    the power-shell cmdlet seems to work quite a bit faster and doesn't cause an interruption.  thank for the help.

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    How your wiki can always stay up-to-date

    Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
    - Increase transparency
    - Onboard new hires faster
    - Access from mobile/offline

    Suggested Solutions

    On July 14th 2015, Windows Server 2003 will become End of Support, leaving hundreds of thousands of servers around the world that still run this 12 year old operating system vulnerable and potentially out of compliance in many organisations around t…
    Go is an acronym of golang, is a programming language developed Google in 2007. Go is a new language that is mostly in the C family, with significant input from Pascal/Modula/Oberon family. Hence Go arisen as low-level language with fast compilation…
    Learn the basics of strings in Python: declaration, operations, indices, and slicing. Strings are declared with quotations; for example: s = "string": Strings are immutable.: Strings may be concatenated or multiplied using the addition and multiplic…
    Learn the basics of if, else, and elif statements in Python 2.7. Use "if" statements to test a specified condition.: The structure of an if statement is as follows: (CODE) Use "else" statements to allow the execution of an alternative, if the …

    761 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    7 Experts available now in Live!

    Get 1:1 Help Now