Select to view content in your preferred language

REST service gone idle throws an exception when first accessed

4093
12
08-10-2010 12:59 PM
StephenDavis
Emerging Contributor
When accessing a map service REST endpoint with any significant number of layers (at least 30 layers or so) that has gone "idle", an error is thrown.  So, if I go to http://servername/arcgis/rest/services/servicename/MapServer and that service hasn't been accessed in a while, the screen will display

----Service 'servicename' of type 'MapServer' does not exist or is inaccessible.

If I wait a few seconds, I can go back to the URL and it will work fine from that point forward.  If it has gone idle, why does it not wake it up and then continue on rather than throwing an exception?  Is there any way to avoid this behavior without setting the time limit at which a map service goes idle really high?  We would still like them to go idle but have them wake up normally and be accessible from the first time it is accessed after being idle.

When this happens, we get the following errors in the log:

Server Context creation failed on machine servername.
Container  process 12624 has crashed on machine servername.

This happens consistently every time and only happens the first time it is accessed each day.  After that it starts up fine and is available.

Thanks!
Stephen
0 Kudos
12 Replies
vipulsoni
Regular Contributor
hi!

My experience about some error of first access are solved by checking the option: "Periodically check and repair data connections for idle instances" with 30 minutes.

What I have found is that my db administrator stop the database for backup issue and after that the service don't work. With this option all is ok.

Note: the service is for editing data. Service with read only data are oks.


This is a issue present still after upgrading to SP2. Even after setting all services with the option "Periodically check and repair data connections for idle instances" with 30 minutes. Does not help if the server has been idle over night.. in the morning whoever is the first to access the SL API application is sure to get a splat ERROR white page.. even though I tried to handle the error from code by layer initialized event..
0 Kudos
mohankumarcn
New Contributor
Can you provide the scripts here?
0 Kudos
IsharaKotiah
Emerging Contributor
I have a VB script that calls the rest endpoints of my production services first thing in the morning. I put the script into a Scheduled Task to be called in the morning and again every 30 minutes. It works perfectly.

If you'd like it, I can supply the code here. I got it from somewhere in the ESRI support forum land, so it may have already been linked here.


Erik

Will appreciate if you can post the code. Thanks very much.

Ishara
0 Kudos