Service not responsive but mmc says its running

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.
LVL 2
Infamous_QAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Brad GrouxSenior Manager (Wintel Engineering)Commented:
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."
0
Infamous_QAuthor Commented:
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.
0
Brad GrouxSenior Manager (Wintel Engineering)Commented:
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.
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
cococanCommented:
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.
0
Infamous_QAuthor Commented:
the power-shell cmdlet seems to work quite a bit faster and doesn't cause an interruption.  thank for the help.
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Scripting Languages

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.