Tuesday, July 14, 2015

IIS Application Initialization Quick Reference


  1.  Need to install application initialization module, if IIS 7.5 it's a separate download or WPI, included in IIS 8
  1. Set startMode to AlwaysRunning on application pool
    1. Open configuration editor in IIS on server root
    2. Select system.applicationHost/applicationPools
    3. Click edit items
    4. Find app pool, select and then change startMode in lower pane to alwaysRunning
    5. Hit Apply This changes C:\Windows\System32\inetsrv\config\applicationHost.config

  1. Set applicationDefault preloadEnabled on site
    1. Open configuration editor in IIS on server root
    2. Select system.applicationHost/sites
    3. Click edit items
    4. Find site and select
    5. Expand applicationDefaults in lower pane
    6. change preloadEnabled to true
    7. Hit Apply This changes C:\Windows\System32\inetsrv\config\applicationHost.config
    8. Note: This only changes the defaults for new apps, you may need to change the existing ones yet. You may not need step 3 if apps already exist…

  1. Set preloadEnabled on site
    1. Open C:\Windows\System32\inetsrv\config\applicationHost.config
    2. Find site you're looking for <site name="www.domain.com" id=…
    3. Add preloadEnabled="true"  to first application element tag
    4. You should see a  <applicationDefaults preloadEnabled="true" /> under the site element if you performed step 3
    5. Restart IIS

  1. Set initalizationPage on site and doAppInitAfterRestart
    1. Open configuration editor in IIS on desired site
    2. Select system.webServer/applicationInitialization
    3. Change from to ApplicationHost.config if you want to create a location element in C:\Windows\System32\inetsrv\config\applicationHost.config, otherwise the change will go in the web.config
    4. Set doAppInitAfterRestart to true
    5. Click edit items
    6. Click add
    7. Enter path for initializationPage ( /folder/page?param=something ), leave hostname blank (I think…)
    8. Click apply


CHANGE IDLE TIME_OUT IN ADVANCED SETTINGS ON APPPOOL TO 0

Monday, July 13, 2015

DPM 2010 Slow when Selecting Roverypoint to Recover

It took almost an hour to select a date and time to recover in DPM 2010. It appeared the this was because of high cpu usage by SQL. The query that seemed to be responsible for this was:

SELECT Path, FileSpec, IsRecursive
    FROM tbl_RM_RecoverableObjectFileSpec
    WHERE RecoverableObjectId = @RecoverableObjectId AND 
          DatasetId = @DatasetId and
          iSgcED = 0

I didn't dig into things too much, but it appeared as though it was running this query for every single recovery point for the item selected and it was doing a clustered index scan for each recovery point. I created the following statistic and covering nonclustered index in the DPM db:

CREATE STATISTICS [_dta_stat_1042102753_9_2_3] ON [dbo].[tbl_RM_RecoverableObjectFileSpec]([IsGCed], [RecoverableObjectId], [DatasetId])

CREATE NONCLUSTERED INDEX [_dta_index_tbl_RM_RecoverableObjectFileSpec_7_1042102753__K2_K3_K9_5_6] ON [dbo].[tbl_RM_RecoverableObjectFileSpec] 
(
[RecoverableObjectId] ASC,
[DatasetId] ASC,
[IsGCed] ASC
)
INCLUDE ( [FileSpec],
[IsRecursive]) WITH (SORT_IN_TEMPDB = OFF, IGNORE_DUP_KEY = OFF, DROP_EXISTING = OFF, ONLINE = OFF) ON [PRIMARY]

Now the above query changed from a clustered index scan to a index seek and key lookup. The time it took to select a recovery point went from about an hour down to a minute.