Not sure if this question goes here or in the customization forum. Apologies if the other, but I think this is a system issue not a coding issue.
We have pretty heavily customized approval workflow that we deploy via a WSP as a reusable workflow. The workflow is started by a JavaScript call to /_vti_bin/Workflow.asmx via the SPServices Codeplex project. The first time the workflow is executed after an app pool recycle it takes a while to start. In our test environments its around 30-45 seconds or so. After the initial warmup of the workflow all subsequent calls to execute the workflow take about 1 second to start. While this is annoying its workable.
However, in production the initial warmup takes about 3 1/2 minutes (we timed this by starting the workflow directly from the Workflows ribbon control). This exceeds the HTTP timeout so the JavaScript call fails when SharePoint/IIS kills the thread and returns a "Request Timed Out" generic error page.
At first we thought maybe the issue was the workflow was taking a long time to initialize all the tasks so we added a step so the first thing the workflow does when it starts is go to sleep for 5 minutes. After the five minute pause the workflow actually starts the task assignment, item updates, etc. So the workflow should start right up then go to sleep for five minutes. This did not help, though.
My question is, how can I improve a workflow's warmup time? I saw the workflow-eventdelivery-throttle, workitem-eventdelivery-batchsize, and workflow-eventdelivery-timeout properties, but changing those values on my test boxes (which really don't have this issue) made no difference. Is there a setting somewhere that I can tell SharePoint to not uncache the XOML when the app pools recycle? Or some other similar knob to turn that will allow the first time the workflow is started to under 1 minute?