0

Possible Duplicate:
How to restart Coldfusion Application Server when application is timeout?

Currently I have an ColdFusion application that causes server issues. After 1-2 days that serve doesn't respond until a manual restart is done. I know that I had to find what is going wrong in my scripts and I spend time and time for several weeks. But pending I would make a script that restart automatically ColdFusion service if it is bugged.

I have not many knowledge in batch script etc.. but I guess that the test would be a request to a .cfm and the response would be serve until a timeout. ?

Has anyone ever met a script like this ?

Config: Win 2k8 Server R2 - Coldfusion 9(.0.0)

Thank you

Community
  • 1
  • 1
LarZuK
  • 746
  • 1
  • 8
  • 16

4 Answers4

1

Two things here

  1. The real way is to fix the issue and you can do that with Fusion Reactor - http://www.fusion-reactor.com/fr/ It will help you monitor and restart and self heal as it needs.

  2. You could create a batch file, and create a Scheduled Task in Windows that ran it. Using Net Start / Net Stop Commands

net stop "Macromedia JRun CFusion Server"

net start "Macromedia JRun CFusion Server"

Thought this may not always work so I have a batch file:

c:\JRun4\uninstall\KillJRun.exe

net start "Macromedia JRun CFusion Server"

Which works for me.

ale
  • 6,369
  • 7
  • 55
  • 65
BigMadKev
  • 2,440
  • 2
  • 17
  • 10
  • Ok thanks. I know fusion reactor and like I said, I'm currently searching a better solution but I want to sleep well ^^ Ok I've seen these commands but, is there a way to launch it only if CF does'nt respond ? – LarZuK Jun 20 '11 at 09:49
1

Your best bet is to use Pingdom or another server monitoring tool. When the server goes down (responds with a 503 error, service unavailable) you may be able to have Pingdom send a response to a PHP script on the server that calls a batch file. I am not sure if Pingdom supports pinging another server is one is down, but you could have Pingdom email to an inbox that your PHP can check every few minutes.

This may end up being more work than figuring out what is wrong with your script though.

Edit: You may want to look at this question. This will only work if the service has stopped, whereas usually when a script crashes ColdFusion it is hanging. If you run the script that crashes the server, then look at the service, if it says stopped, then this may work for you.

The other thing that I would check is the JVM memory. Often times crashes are due to processing large amounts of data from files or the database and the JVM doesn't have the memory to do that.

Community
  • 1
  • 1
Dave Long
  • 9,569
  • 14
  • 59
  • 89
  • Make sure you lock down that PHP script you call from Pingdom or someone could cause you some real problems. – Ciaran Archer Jun 20 '11 at 14:24
  • Yeah. For that your options are to check the IP requesting against the Pingdom server list, or have Pingdom do a POST request with some sort of password. – Dave Long Jun 20 '11 at 19:21
0

Nope. It cannot be restart automatically when your CF services/server is hanging. The only one way is to restart by windows schedule.

PPShein
  • 13,309
  • 42
  • 142
  • 227
0

You could also use Nagios+Plugins to fire a restart script when the service hangs. But following the previous advice & finding out what the problem is is your best bet.

Sean Kimball
  • 4,506
  • 9
  • 42
  • 73