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

Streamlined the site-creation process #1013

Merged
merged 1 commit into from
Mar 30, 2016

Conversation

TeslaDethray
Copy link
Contributor

As seen on https://sprint.ly/product/27143/item/1333

Creating sites when you're in an org with a large number of sites is time-consuming. Here are the three scenarios:

Experiment

Cycle through this method for each of the three scenarios, alternating.

  1. Clear cache
  2. Log in via machine token
  3. Time the creation of a WP site called 'saras-other-test-site'
  4. Save the time
  5. Delete created site to reset, start at 1.

Each scenario was run 10 times and the numbers averaged.

No org, no sites sites create time:

real 1m55.579s
user 0m0.387s
sys 0m0.088s
Actions:

  • Checks product list
  • Starts site-creation workflow
  • Checks on the status of that workflow 23 times
  • Gets a full list of the user's sites
  • Pulls in basic info for the new site
Pantheon Employees org member, many sites, not adding site to org sites create time:

real 2m15.851s
user 0m0.566s
sys 0m0.210s
Actions:

  • Checks product list
  • Starts site-creation workflow
  • Checks on the status of that workflow 26 times
  • Gets a full list of the user's sites
  • Pulls in basic info for the new site
Pantheon Employees org member, many sites, adding site to org sites create time:

real 3m37.987s
user 0m0.677s
sys 0m0.218s
Actions:

  • Checks all organizational memberships to see that user is a member and can add to that organization.
  • Checks product list
  • Starts site-creation workflow
  • Checks on the status of that workflow 37 times
  • Gets a full list of the user's sites
  • Pulls in basic info for the new site

Proposed Solution

So there are three things slowing org members down when they create sites:

  1. Only if they are creating a site belonging to an org, we must look for all organization memberships to ensure they can add to it.
  2. We have to look up the UUID of the upstream to use.
  3. Creating the sites list at the end will certainly slow down the creator.

We can stop #3 entirely and ameliorate 1 and 2 by allowing the user to put in a UUID for either the org or the upstream, which will then skip the checks required when a name is given instead.

Re-testing

Each scenario was run 10 times and the numbers averaged.

No org, no sites sites create time:

real 1m53.251s
user 0m0.351s
sys 0m0.090s
Actions:

  • Starts site-creation workflow
  • Checks the status of that workflow 24 times
  • Pulls in basic info for the new site
Pantheon Employees org member, many sites, not adding site to org sites create time:

real 1m32.016s
user 0m0.320s
sys 0m0.093s
Actions:

  • Starts site-creation workflow
  • Checks the status of that workflow 17 times
  • Pulls in basic info for the new site
Pantheon Employees org member, many sites, adding site to org sites create time:

real 1m41.214s
user 0m0.344s
sys 0m0.096s
Actions:
-Starts site-creation workflow
-Checks the status of that workflow 21 times
-Pulls in basic info for the new site

@bensheldon
Copy link
Contributor

👍

@TeslaDethray TeslaDethray merged commit b1f330e into master Mar 30, 2016
@TeslaDethray TeslaDethray deleted the enhancement/faster_site_creation branch March 30, 2016 22:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants