Link to home
Start Free TrialLog in
Avatar of lyrix1999
lyrix1999

asked on

Restart the CF application service automatically?

The are something wrong with our system lately that  the application hangs from time to time. I am not 100% confident what it's causing this but one thing I am sure our database server is under powered, where we store the session variables. When the DB server is slow, our application hangs... However, when the DB server backs to normal,  we have to restart the cold fuion service manually anyway. Besides buying a new DB server, what should I do to prevent this? I thought it's going to restart itself because:

I have the following settings in the administrator page.

Limit simultaneous requests to  10
Timeout requests after  1200 seconds
Restart at 10 unresponsive requests
Restart when requests terminate abnormally

Are they good settings? I am also thinking about restart the application service once every night, just to clear any cumulative memory leak from previous days or maybe just for fun ... Is there a way to do it?
Avatar of kjuliff
kjuliff

I stop and start mt CF server twice a day with scheduled tasks. Depending upon your operating system, just modify the .bat file

at 04:30 /every:M,T,W,Th,F,S,Su net stop "Cold Fusion Executive"
at 04:31 /every:M,T,W,Th,F,S,Su net stop "Cold Fusion RDS"
at 04:33 /every:M,T,W,Th,F,S,Su net stop "Cold Fusion Application Server"
at 04:35 /every:M,T,W,Th,F,S,Su net start "Cold Fusion Application Server"
at 04:36 /every:M,T,W,Th,F,S,Su net start "Cold Fusion RDS"
at 04:37 /every:M,T,W,Th,F,S,Su net start "Cold Fusion Executive"
On restarting - I have had no problem, even with an overloaded srever. Here are my settings
Limit simultaneous requests to 5
Timeout requests after   seconds 360
Restart at   unresponsive requests 3
 Restart when requests terminate abnormally (checked)
Avatar of lyrix1999

ASKER

Kjuliff, thanks for your comments.

What .bat file? Or do you just create two .bat (stop and start), and run them in windows' scheduler task? I usually only stop/start application server, what's the role for CF Executive and CF RDS service?
Yes. Creat a bat file to set up the start and stop. It is generally called cf.bat.

Then run it once. It sets up the schedule.

You will not need the RDS in your version of CF (that was from an earlier one and I forgot it was there - sorry). Executive may as well stop and start too. It handles scheduled tasks and other things but  I like to clear everything out twice a day.

You just need one .bat file. Of course you could type it all into the Windows scheduler but I just find this is easier. It's easier to edit the times.


Thanks. Actually I was searching if there is a .bat in the folder, I did find one in

\cfusion\bin\cycle.bat.

Looks like it has exactly same code you posted... and the REM line basically indicates the same thing you said... Cool, I never knew you can write a .bat file with 'at' clause...

I am wondering since it looks like being written by Alliure, do I have to add the .bat into scheduler, or it has been in there or called by the CF server to restart every night and I just didn't know...
ASKER CERTIFIED SOLUTION
Avatar of kjuliff
kjuliff

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Thanks. Now I understand this batch file is for adding the automatic stop/start in the windows scheduler.

Hope it can fix my problem.