Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Windows Setup doc; offer 10x perf improvement #58259

Open
wants to merge 4 commits into
base: devel
from

Conversation

Projects
None yet
6 participants
@petemounce
Copy link
Member

commented Jun 23, 2019

SUMMARY

Add a section to the Windows Setup documentation about how to get a 10x performance improvement over cleanly installed Windows.

ISSUE TYPE
  • Docs Pull Request
COMPONENT NAME

lib/ansible/plugins/connection/ssh.py
lib/ansible/plugins/shell/powershell.py

ADDITIONAL INFORMATION

We found that when we did this, tasks that were taking ~6s dropped to low hundreds-of-milliseconds.

One playbook (over winrm) went from 25m35s to 8m9s. SSH connection benefits similarly.

Thought you might like to offer it to users, and this seemed like an appropriate place.

All credit to @ca-johnson for the diligent profiling work he did!

@ansibot

This comment has been minimized.

Copy link
Contributor

commented Jun 24, 2019

@petemounce This PR contains @ mentions in at least one commit message. Those mentions can cause cascading notifications through GitHub and need to be removed. Please squash or amend your commits to remove the mentions.

click here for bot help

@ansibot

This comment has been minimized.

Copy link
Contributor

commented Jun 24, 2019

@nitzmahone
Copy link
Member

left a comment

Hrm, I think this is a good thing to have in our docs, but I'm thinking we might need a "troubleshooting / performance" page, rather than plopping it in the middle of the (already scarily large) "initial setup" page... This is only a problem if your install/imaging process has somehow invalidated the NI cache- Powershell is always ngen'd "out of the box" on 2012R2+ in my testing...

@petemounce petemounce force-pushed the petemounce:patch-1 branch from 99187c0 to 524744a Jun 25, 2019

@samdoran samdoran removed the needs_triage label Jun 25, 2019

@petemounce

This comment has been minimized.

Copy link
Member Author

commented Jul 2, 2019

@nitzmahone happy to do that - please tell me where I should place the new documentation file and how to name it, and I'll slice and dice?

I've observed this optimisation to be necessary with out-of-the-box GCE Windows 2016 images and AWS AMIs (the latter in circa 2015, though; might have moved on, I haven't needed to know in a little while).

@jborean93

This comment has been minimized.

Copy link
Contributor

commented Jul 4, 2019

@acozine or @samccann do you have a suggestion for @petemounce to place performance tips and tricks for Windows?

@acozine

This comment has been minimized.

Copy link
Contributor

commented Jul 9, 2019

@jborean93 yep!
@petemounce could you create a new file called docs/docsite/rst/user_guide/windows_performance.rst, put this content (and any additions) there, and add it to the TOC for the Windows guide below the windows_dsc entry on the main Windows page? Ping me with questions, here or in #ansible-docs on freenode IRC.

@acozine

This comment has been minimized.

Copy link
Contributor

commented Jul 9, 2019

@petemounce see also https://docs.ansible.com/ansible/latest/dev_guide/style_guide/index.html for some pointers/help on creating rst pages.

petemounce added some commits Jun 23, 2019

Windows Setup; document 10x perf improvement
We found that when we did this, tasks that were taking ~6s dropped to low hundreds-of-milliseconds.

One playbook (over winrm) went from 25m35s to 8m9s. SSH connection benefits similarly.

Thought you might like to offer it to users, and this seemed like an appropriate place.

All credit to Carl for the diligent profiling work he did!

@petemounce petemounce force-pushed the petemounce:patch-1 branch from 524744a to 4b168fd Jul 18, 2019

@petemounce

This comment has been minimized.

Copy link
Member Author

commented Jul 18, 2019

@acozine @jborean93 - sure; how's this?

@ansibot

This comment has been minimized.

Copy link
Contributor

commented Jul 18, 2019

The test ansible-test sanity --test docs-build [explain] failed with 1 error:

docs/docsite/rst/index.rst:55:0: literal-block-lex-error: Could not lex literal_block as "powershell". Highlighting skipped.

click here for bot help

@ansibot

This comment has been minimized.

@jborean93
Copy link
Contributor

left a comment

Just a few minor points. I will let @acozine and @samccann comment on the actual text. From a dev perspective this is all good to me.

PowerShell snippet in an Administrator session. Expect it to take tens of
seconds.

Note - if native images have already been created by the ngen task or service,

This comment has been minimized.

Copy link
@jborean93

jborean93 Jul 21, 2019

Contributor

You should use the rst note structure, e.g.

.. note::
    If native images have already been created by the ngen task or service, you will observe not difference in performance.
Optimize-PowershellAssemblies

PowerShell is used by every Windows Ansible module. This optimisation reduces
the time PowerShell takes to start up by around 10x.

This comment has been minimized.

Copy link
@jborean93

jborean93 Jul 21, 2019

Contributor

I personally would be careful putting a metric to the performance improvement and just state that because the time it takes to startup PowerShell has been reduced each task would therefore be quicker. I would have to let @acozine or @samccann chime in though as they are a lot better at writing docs than I am.

.. code-block:: yaml
- name: generate native .NET images for CPU
win_dotnet_ngen: {}

This comment has been minimized.

Copy link
@jborean93

jborean93 Jul 21, 2019

Contributor

No need for the {}, just do win_dotnet_ngen:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.