Select to view content in your preferred language

Flex Viewer - Slow to start

1141
10
11-16-2010 06:10 AM
ChrisOwen
Occasional Contributor
Why does the flexviewer take so long to start up?
This is especially apparent in the morning when just starting up the flex site.  It seems I need to delete cookies, then CTRL + F5 a few times before the site actually displays map data.
Anyone know the cause for this and how to fix it?
Thanks!
Chris
Tags (2)
0 Kudos
10 Replies
KeithPalmer
Emerging Contributor
Chris,

It sounds like you have a case of the sleeping web services.  A common ailment that is curable.  If you are running AGS 9.3 then you will need to put the attached file on a computer and schedule a job to have it run every 20 minutes.  Any longer and the services will go nighty night.  You will need to rename the script from .txt to .vbs and then edit the name of the web servers and AGS web services.

If you are using AGS 10 then there are tools available for fixing broken connections.  This info is @ http://help.arcgis.com/en/arcgisserver/10.0/help/arcgis_server_dotnet_help/index.html#//009300000069....

Good luck,
Keith
0 Kudos
ChrisOwen
Occasional Contributor
Thanks Keith!
I'll put this into place and post the results.
0 Kudos
ChrisOwen
Occasional Contributor
Keith,
I tried running it from the server, received errors.  I changed the AGS server and services - they look good.
1st attempt:  I ran it, then pressed OK each time the error message window displayed.
2nd attempt:  I let it run without pressing OK - after 10 imuntes clicked OK and received error messages.
Any ideas?

Thanks,
Chris
0 Kudos
KeithPalmer
Emerging Contributor
Chris,

What error messages are you receiving?

-Keith
0 Kudos
ChrisOwen
Occasional Contributor
Keith,
There are the errors built into the code.
The 1st window displays "Navigating to http://..." - I click OK
The 2nd window displays "Pausing for 10ms wjile IE is busy..." - I click OK
The 3rd window displays "IE navigation failed!" - I click OK
The 4th window displays "Error:  9" - I click OK
The 5th window displays "Subscript out of range" - I click OK
It keep going with error messages.

I assume this is supposed to run with no interaction from the user, although there are buttons which seem to execute the refresh.  I must be missing something here.

Chris
0 Kudos
ChrisOwen
Occasional Contributor
It appears to be working.  I created a schedule event on the server and let it run.  When I fired the flexviewer up, bang - data displayed.
I was running the script manually, which is why the errors appeared.
Nice work Keith!
Chris
0 Kudos
KeithPalmer
Emerging Contributor
Chris,

I wasn't clear enough explaining that you did need to create a scheduled event to run this.  The script has error logging that writes to the event logs, but if you run it interactively then you get the messages posted to the screen.  That said, it is good you ran it interactively since it appears to be having a problem.  Based on the errors you posted I think you need to change the array size on the "Dim servers" or "Dim services" line.  In vbscript, arrays are "0" based.  That means if you have a single item the array size would be "0" (like Dim servers(0)).  If you have two items the array size would be "1".  You are getting a subscript out of range error which is likely because the array is larger then the number of elements you have.  Check the servers and services arrays to be sure you the size is correct.  Also, once the script is working properly, you can take the LogIt lines out of the loop so they don't fill up your event log.

-Keith
0 Kudos
ChrisOwen
Occasional Contributor
I updated the script and I ran it interactively without errors.  I updated the # of Dim servers to the correct #, and it is working perfectly.
Thanks for following up, as the script was probably only re-starting the first two services since Dim servers was set to 1.
Thanks again!
Chris
0 Kudos
ChrisOwen
Occasional Contributor
Keith -
All services start perfectly with exception of one service.  It was the very last service in the dim array; so I decided to place it in the second to last position - still does not refresh.  So far, the only solution is to refresh the service manually from ArcCatalog or from ArcGIS Server via the web browser.
Any thoughts?
Chris
'declare a counter variable as integer, set it to zero
Dim counter
counter = 0

'declare array for server names
Dim servers(8)
servers(0)="gis"

'declare array to hold names of different services
Dim services(8)
services(0)="GISBaseMap_web_t/MapServer"
services(1)="GISBaseMap_Streets/MapServer"
services(2)="GISBaseMap_parcels/MapServer"
services(3)="GISBaseMap_stuts/MapServer"
services(4)="GISBaseMap_suts/MapServer"
services(5)="GISBaseMap_Transportation/MapServer"
services(6)="GISBaseMap_wuts/MapServer"
services(7)="GISBaseMap_JCDA/MapServer"
services(8)="GISBaseMap_wwciOrtho08_wwcOrtho06_t/MapServer"
0 Kudos