Upgrade to Pro — share decks privately, control downloads, hide ads and more …

About Consul

About Consul

July Tech Festa 2014 slides #techfesta #consul

Michael H. Oshita

June 22, 2014
Tweet

More Decks by Michael H. Oshita

Other Decks in Technology

Transcript

  1. ABOUT ME (@IJIN) • Michael H. Oshita • Japanese American

    • 10+ Years in Japan • Software/Infra/Cloud Engineer • http://ijin.github.io
  2. TECHNOLOGY • Consensus Protocol (Raft, FSM) In Search of an

    Understandable Consensus Algorithm - Stanford University • Gossip Protocol (Serf) SWIM: Scalable Weakly-consistent Infection-style Process Group Membership - Cornel University • Sessions (Chuby) The Chubby Lock Service for Loosely-Coupled Distributed Systems - Google • TLS, Jespen Testing !
  3. CONSISTENCY default ! ! consistent: ! ! stale: "?state" or

    "?consistent" parameter ɾେମStrongly Consistent ɾ৽Leaderঢ֨࣌ʹstale readͷՄೳੑ͋Γɻ ɾ଎͍ ! ɾStrongly Consistent ɾLeader͸QuromͰ֬ೝ ɾLatency͕ൃੜ͢ΔͷͰएׯ஗Ί ! ɾStale Readɺޡࠩ͸֓Ͷ50ms͙Β͍ ɾLeaderҎ֎ͷServer͕Ԡ౴Մ ɾߴ଎
  4. CONSUL AGENT DNS CACHING Stale Reads ɾࢀর͸σϑΥϧτͰLeader NodeͷΈ ɾ༗ޮԽ͢ΔͱଞͷServer Node͔ΒࢀরՄೳ

    ɾεϧʔϓοτ޲্ ɾmax_staleͰ࣌ؒΛઃఆ ! TTL ɾDNS TTL͸σϑΥϧτͰ0 ɾdnsmasq౳ͰΩϟογϡՄೳʹ { "dns_config": { "service_ttl": { "*": "5s", "web": "30s" } } new! (0.3.0)
  5. CONSUL AGENT HTTP API /v1/agent/checks /v1/agent/services /v1/agent/members /v1/agent/self /v1/agent/join/<address> /v1/agent/force-leave/<node>

    /v1/agent/service/deregister/<serviceID> agent endpoint: /v1/agent/register /v1/agent/deregister/<checkID> /v1/agent/pass/<checkID> /v1/agent/warn/<checkID> /v1/agent/fail/<checkID> /v1/agent/service/register
  6. CONSUL AGENT HEALTH CHECK { "service": { "check": { "script":

    "curl localhost > /dev/null 2>&1", "interval": "10s" } } check definition:
  7. CONSUL AGENT HEALTH CHECK Exit Code 0 - Check is

    passing ! Exit Code 1 - Check is warning ! Any Other - Check is failing check script:
  8. BENCHMARK GET 8 CPU Cores, 2Ghz 16GB RAM 160GB SSD

    disk 1Gbps NIC Requests/sec rps 0 2750 5500 8250 11000 10,469.54 1,054.031 v0.2.0 v0.3.0
  9. BENCHMARK GET response time distribution # of responses 0.00 3000.00

    6000.00 9000.00 12000.00 response time (s) 0.001 0.007 0.014 0.017 0.023 0.030 0.033 0.062 0.094 0.125 0.156 v0.2.0 v0.3.0 8 CPU Cores, 2Ghz 16GB RAM 160GB SSD disk 1Gbps NIC