Slowdown in app using Word 2013 interop on Win2008R2 session hosts

We're experiencing a significant disparity in performance when running an in-house app on session hosts compared to running on local PCs.  There is a particular session host the app is used on, but we have tested on other session hosts and getting the same results.

A particular process with the same test data takes 2 minutes on the session host and 30 seconds on the PC.  It has been tested on the session host when no one is logged in.  And we've also tried turning AV off - all Word add-ins are disabled.

We've narrowed it down to a bit of code that is calling setupstyles on the document object that has been loaded.

Session host details:
- Hyper-V VM running Win2008R2 64-bit
- Office 2013 32-bit
- 26 VPU in NUMA nodes
- 32GB static memory
- 8 x local 15k SAS drives in RAID10 using PERC710 controller - these are dedicated to the session host VM
- 1Gbps connection to network

PC details:
- Windows 7 Pro 32-bit
- Office 2013 32-bit - exactly the same config as the session host as all deployed and customised through the same group policies
- Dual core processor
- Single 7200k SATA drive
- 1Gbps network connection

When testing the problematic process on each platform we can see the following in perfmon:

Session host:
- Processor usage staying below 40% (that's when it's loaded with 20 or 30 users)
- Processor queue staying below 5
- Memory usage around 13GB
- Disk latency less than 5ms
- Disk queue depths less than 2

- Processor usage going up to 80%
- Memory usage around 50%
- Much higher latency and queue depths on the disk compared to the session host

Disk benchmarking shows the throughput on the session host storage is around 9 times that of the PCs.

So without sitting in the user's chair it would be fair to assume the session host is performing the task faster - but it's not.

Roaming profiles used on both PC and session host with no redirection - so process will be using the local disk in each case for writing any temp data.

So what exactly is happening when the setupstyles method is being called?
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

devon-ladAuthor Commented:
Bit more detail on the code.

When stepping through the code on a session host it's a for loop that is checking for a style name and then updating the style.  This takes much longer on the session host than on the PC.
Try changing the default printer to fax on all machines.... word probably trying to communicate with printer somewhere
devon-ladAuthor Commented:
When testing on the session host, I'm setting the default printer to Microsoft XPS - and have been logging in at the console so there is no printer redirection going on.
IT Pros Agree: AI and Machine Learning Key

We’d all like to think our company’s data is well protected, but when you ask IT professionals they admit the data probably is not as safe as it could be.

Default styles? Where is the template located?  Try changing the template to the Normal template?

Time each iteration of the for loop?
devon-ladAuthor Commented:
Changing the style settings for Headings 1 to 3 and Normal.  Template is Normal template stored locally as far as I'm aware.
devon-ladAuthor Commented:
This was solved by creating separate templates that were loaded as needed instead of always loading the Normal template and then making changes.

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Old template might have been bloated with styles?  Tnx for sharing.
devon-ladAuthor Commented:
Found own solution.
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today

From novice to tech pro — start learning today.