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

Automate /moodle/html local copy on VMSS (naively fixes #59) #61

Merged
merged 6 commits into from
Mar 23, 2018

Conversation

hosungsmsft
Copy link

Issue #59 kept bugging me, so this is my naive & rudimentary trial to support the /moodle/html local copy feature.

Each VMSS VM will poll (every minute, using cron) the /moodle/html/moodle/.last_modified_time... file with /var/www/html/moodle/.last_modified..., and if they are different, the /moodle/html/moodle content will be synced to /var/www/html/moodle. Moodle admin should manually run /usr/local/bin/update_last_modified... script after every /moodle/html/moodle update.

This whole feature is controlled by a new boolean template switch (htmlLocalCopySwitch), and it's defaulted to false to retain the existing behavior. Both scenarios were tested and confirmed to work.

@SorraTheOrc
Copy link
Contributor

Couple of questions on this one...

  1. Unless I'm missing it the VM will take around 1min for the first sync to complete. During this time is there a danger that the LB see the VM as avialalbe and route traffic to it?

  2. Why use a manual "last modified" file rather than simply call rsync via the cron job? or using Is it simply to reduce the work overhead, or is there some other motivation?

In general I think this is OK as an optional feature. I do think it needs documenting though, nothing too fancy just the outline steps in a new file at docs/moodle_file_sync.md:

  • Update files in /moodle
  • Update last modified file
  • wait 1 minute

@hosungsmsft
Copy link
Author

Thanks for your quick review! My answers to your questions...

  1. The first sync is done always at the VM instance deployment time (setup_webserver.sh), and since the instance is not considered up, until the deployment is over, I think LB won't see that instance (newly scaled-out) before the first sync and there should be no traffic routed to that newly scaled-out VM instance. Does this make sense?
  2. It's mostly to reduce the work overhead. I saw that each rsync call still traverses the entire directory, which could be costly for every minute, so I just wanted to minimize that overhead, by keeping such a timestamp. I know it's kind of ugly, but I think it's simple and enough... :)

Yeah, totally agreed with the documentation. Could you kindly create one for this? Thanks in advance!

@hosungsmsft hosungsmsft merged commit 2f27358 into master Mar 23, 2018
@hosungsmsft hosungsmsft deleted the pr-html-local-copy branch March 23, 2018 17:14
@SorraTheOrc
Copy link
Contributor

SorraTheOrc commented Mar 23, 2018

Thanks, makes sense.

Re Docs. I'm about to hit 2 weeks of travel and vacations. I'll not be able to do it for some time. Can you provide the initial content. Just the basics to run, and where. No need for fully descriptive test.

@hosungsmsft
Copy link
Author

Sure. Filed issue #62 for tracking.

I'm also starting another perf test with gluster and this feature turned on.

@SorraTheOrc
Copy link
Contributor

Thank you. Once the skeleton is there l will improve when l return.

@hosungsmsft
Copy link
Author

Happy to report that a load test run with this feature on and gluster as the file server showed much improved performance that's now comparable to NFS (row 28 in spreadsheet).

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.

2 participants