graphite scale
play

Graphite@Scale: How to store million metrics per second Vladimir - PowerPoint PPT Presentation

Graphite@Scale: How to store million metrics per second Vladimir Smirnov System Administrator LinuxCon Europe 2016 5 October 2016 Why you might need to store your metrics? Most common cases: Capacity planning Troubleshooting and


  1. Graphite@Scale: How to store million metrics per second Vladimir Smirnov System Administrator LinuxCon Europe 2016 5 October 2016

  2. Why you might need to store your metrics? Most common cases: ◮ Capacity planning ◮ Troubleshooting and Postmortems ◮ Visualization of business data ◮ And more...

  3. Graphite and its modular architecture From the graphiteapp.org ◮ Allows to store time-series data ◮ Easy to use — text protocol and HTTP API ◮ You can create any data flow you want ◮ Modular — you can replace any part of it

  4. Open Source stack User Requests LoadBalancer graphite-web graphite-web graphite-web graphite-web graphite-web graphite-web carbon-cache carbon-cache carbon-cache carbon-cache Store1 Store2 Store1 Store2 DC1 DC2 carbon-aggegator carbon-relay Metrics Servers, Apps, etc

  5. Breaking graphite: our problems at scale What’s wrong with this schema? User Requests LoadBalancer ◮ carbon-relay — SPOF graphite-web graphite-web ◮ Doesn’t scale well graphite-web graphite-web graphite-web graphite-web ◮ Stores may have carbon-cache carbon-cache carbon-cache carbon-cache Store1 Store2 Store1 Store2 different data after DC1 DC2 failures carbon-aggegator carbon-relay ◮ Render time increases Metrics Servers, Apps, etc with more store servers

  6. Replacing carbon-relay User Requests LoadBalancer graphite-web graphite-web graphite-web graphite-web graphite-web graphite-web carbon-cache carbon-cache carbon-cache carbon-cache Store1 Store2 Store1 Store2 carbon-c-relay carbon-c-relay carbon-c-relay DC1 DC2 carbon-c-relay Metrics Servers, Apps, etc Server

  7. Replacing carbon-relay carbon-c-relay: ◮ Written in C ◮ Routes 1M data points per second using only 2 cores ◮ L7 LB for graphite line protocol (RR with sticking) ◮ Can do aggregations ◮ Buffers the data if upstream is unavailable

  8. Zipper stack: Solution Query: target=sys.server.cpu.user Result: t0 V V V V V t1 Node1 t0 V V V V V t1 Node2 V V V V t1 Zipped metric t0 V V V

  9. Zipper stack: architecture User Requests LoadBalancer graphite-web graphite-web carbonzipper carbonzipper carbonserver carbonserver carbonserver carbonserver carbon-cache carbon-cache carbon-cache carbon-cache Store1 Store2 Store1 Store2 DC1 DC2

  10. Zipper stack: results ◮ Written in Go ◮ Can query store servers in parallel ◮ Can ”Zip” the data ◮ carbonzipper ⇔ carbonserver — 2700 RPS graphite-web ⇔ carbon-cache — 80 RPS.

  11. Metric distribution: how it works Up to 20% difference in worst case

  12. Metric distribution: jump hash

  13. Rewriting Frontend in Go: carbonapi User Requests LoadBalancer graphite-web carbonapi carbonzipper carbonserver carbonserver carbon-cache carbon-cache Store1 Store2 carbon-c-relay DC1

  14. Rewriting Frontend in Go: result ◮ Significantly reduced response time for users ( 15s ⇒ 0.8s ) ◮ Allowes more complex queries because it’s faster ◮ Easier to implement new heavy math functions ◮ Also available as Go library

  15. Replication techniques and their pros and cons a,h c,a e,f g,b b,c d,e f,d h,g Replication Factor 2

  16. Replication techniques and their pros and cons a,e c,g a,e c,g b,f d,h b,f d,h Replication Factor 1

  17. Replication techniques and their pros and cons a,e c,g a,g h,e b,f d,h c,f b,d Replication Factor 1, randomized

  18. Replication techniques and their pros and cons

  19. Replication techniques and their pros and cons

  20. Our current setup ◮ 32 Frontend Servers ◮ 200 RPS on Frontend ◮ 30k Metric Requests per second ◮ 11 Gbps traffic on the backend ◮ 200 Store servers in 2 DCs ◮ 2M unique metrics per second ( 8M hitting stores) ◮ 130 TB of Metrics in total ◮ Replaced all the components* * — except for carbon-cache

  21. What’s next? ◮ Metadata search (in progress) ◮ Solve problems with missing Cache (in progress) ◮ Find a replacement for Whisper ◮ Improve aggregators ◮ Replace graphite line protocol between components

  22. It’s all Open Source! ◮ carbonzipper — github.com/dgryski/carbonzipper ◮ carbonserver — github.com/grobian/carbonserver ◮ carbonapi — github.com/dgryski/carbonapi ◮ carbon-c-relay — github.com/grobian/carbon-c-relay ◮ carbonmem — github.com/dgryski/carbonmem ◮ replication factor test — github.com/Civil/graphite-rf-test

  23. Questions? vladimir.smirnov@booking.com

  24. Thanks! We are hiring! https://workingatbooking.com

Download Presentation
Download Policy: The content available on the website is offered to you 'AS IS' for your personal information and use only. It cannot be commercialized, licensed, or distributed on other websites without prior consent from the author. To download a presentation, simply click this link. If you encounter any difficulties during the download process, it's possible that the publisher has removed the file from their server.

Recommend


More recommend