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

Roll out API Umbrella v0.7 to servers #180

Closed
GUI opened this issue Feb 9, 2015 · 1 comment
Closed

Roll out API Umbrella v0.7 to servers #180

GUI opened this issue Feb 9, 2015 · 1 comment
Assignees

Comments

@GUI
Copy link
Member

GUI commented Feb 9, 2015

We upgraded to API Umbrella v0.7 last night, which fixed some important edge-cases around DNS handling and analytics gathering. I just wanted to document the fact that this upgrade happened here and also document the steps taken on the servers for the upgrade (in case it helps with future upgrades--although, there are pieces of this upgrade process and how we manage these servers that could probably be streamlined):

  • Update Chef cookbook on each server: cd /opt/chef/solo/api-umbrella && git pull && rm -rf /opt/chef/solo/cookbooks && /opt/chef/embedded/bin/berks vendor /opt/chef/solo/cookbooks
  • Upgrade DB servers first, one at a time.
    • Ensure there are at least 3 members of the replicaset: mongo --eval "printjson(rs.status())"
    • Operate on the mongo secondary nodes first.
    • Stop API Umbrella: /etc/init.d/api-umbrella stop
    • Run chef on secondaries: chef-solo -c /etc/chef/solo.rb -j /etc/chef/solo.json
    • Force a mongo secondary to be primary (use the priority based approach to prevent downtime).
    • After primary is switched over, stop API Umbrella on old primary and run chef on that server.
  • Upgrade web servers
    • Remove one server from all the ELBs. Wait a couple minutes to be sure traffic stops to that server.
    • Stop API Umbrella: /etc/init.d/api-umbrella stop
    • Run chef: chef-solo -c /etc/chef/solo.rb -j /etc/chef/solo.json
    • Verify that a localhost connection works: curl -v "http://localhost/nrel/alt-fuel-stations/v1.json?limit=1&api_key=DEMO_KEY"
    • Add server back to ELBs. Wait a couple minutes for it to start seeing traffic.
    • Repeat for each web server.
@GUI GUI self-assigned this Feb 9, 2015
@GUI GUI added this to the Sprint 14 (1/26-2/6) milestone Feb 9, 2015
@GUI GUI closed this as completed Feb 9, 2015
@GUI
Copy link
Member Author

GUI commented Feb 10, 2015

Oh, and just an extra bonus of rolling out this release: we've seen a pretty good improvement in our average CPU usage and system load on our servers after rolling out this update (I think it's related to the changes and improvements in how we gather log data):

Here are some charts of load and CPU use before and after the flip at approximately midnight:

screen shot 2015-02-09 at 7 21 59 pm

screen shot 2015-02-09 at 7 22 25 pm

At our average system state, the CPU use has gone down from around 15% to less than 5%. Hooray for efficiency!

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

No branches or pull requests

1 participant