Manage Map Server Cache Tiles tool completing too quickly with Python

1331
9
01-14-2021 12:35 PM
Kara_Shindle
Occasional Contributor III

So I have a script that is supposed to update tile caches on the server, and it is putting out messages that it is completing successfully.  However, this tool is completing in less then 10 seconds for two different service caches.  Running the tool manually is around 10 minutes or more for one of these, as the tiles are updating based on an AOI with hundreds of polygons.  

 

My server is old and slated for upgrade, and we routinely have to restart it as it's hanging onto old cache tiles.  I don't think the python cache update is working, but again it is difficult to tell due to the server hanging onto old tiles. 

My Spidey senses are tingling - the script really shouldn't take less then 10 seconds, should it?

 

Edit:  I just converted this to Python 3, it worked perfectly in 2.7 and took about 12 minutes.

9 Replies
DanPatterson
MVP Esteemed Contributor

Now don't go giving people the impression that python 3 is slower than 2.7 😁


... sort of retired...
0 Kudos
by Anonymous User
Not applicable

This is timely... A script I am trying to run yesterday and this morning (comparing two building footprint featureclasses for differences in building centroid, area difference, overlap, new build flag, and some other calculated items) in 3 and kept bombing out at around building 250, taking ~ 4 hours.  Switched back to 2.7 and it ran through the 66k features in a little under 3 hours.  I wonder if 3 has performance issues with some of the v3 method's logic. 

0 Kudos
Kara_Shindle
Occasional Contributor III

I'm having an issue with a map series / data driven pages set of scripts. 

0 Kudos
by Anonymous User
Not applicable

I understand,  I was just adding that I too am having issues with 3.

by Anonymous User
Not applicable

That does seem odd. Next time you run the geoprocessing tool manually in ArcGIS Pro, can you go to the History pane, locate the result, right-click the item and copy the Python command? I would want to make sure that the command in the Python script is exactly the same as what is running behind the scenes when executing the geoprocessing tool through the interface.

Kara_Shindle
Occasional Contributor III

First thing I did.  Compared it and it is exactly the same, baring the connection pathway.

This is driving me nuts.  I've also got a Reconcile Versions python tool holding onto a previous run settings where I ran only one version, even when the tool has 5 versions as inputs.

Lord save me! 😑

0 Kudos
by Anonymous User
Not applicable
  1. What Python IDE are you using to execute the script?
  2. What are the differences between the connection pathways being used here?
0 Kudos
by Anonymous User
Not applicable

Hi @Kara_Shindle ,

I have had a problem that sounds exactly like the one you are describing above.
I had to eventually break out WireShark to see that the script was not even making the call out to the Cache location.  It would still return a positive result, but nothing was happening.

From what I can recall, there was an issue with using the domain name to hit the cache server, and an issue with the cache server accepting connections from my DEV machine.

Not sure how much help this will be and i wish you be best of luck in finding the solution.

 

Thanks,

 

Michael

Kara_Shindle
Occasional Contributor III

This helps and at least gives me a place to start, thanks!

0 Kudos