~/talk

Optimizing Go for Clouds

Talkat GopherCon UK 2021 · 2021-10-25..10-27· [go]
slides:none on file

Kubelet metric collection wastes CPU and GC time by allocating 5k DTO metrics on every scrape, producing ~8 MB and ~200k heap allocations per collect; goal is to cut allocations to about the raw data size. Reproduction uses Go microbenchmarks, pprof and benchstat to measure and compare. Fixes include caching DTOs, pre-allocating and reusing slices, and correcting label-sorting to avoid churn. Results drop allocations to <1MB / 25k allocations for 5k metrics and land within scrape timing.

AI-written summary · about

  1. 0:00Introduction
  2. 0:53Who am I
  3. 1:54Why this topic
  4. 3:57Outline
  5. 4:20Theory
  6. 4:49Speed Efficiency
  7. 4:59Efficiency
  8. 6:55Efficiency Speed
  9. 7:17Counter Arguments
  10. 7:54Why would you optimize
  11. 10:12Now hearing all of this
  12. 10:26Optimization kills readability
  13. 11:44Premature optimization
  14. 12:02Hardware is getting faster
  15. 14:37Scale horizontally
  16. 14:47Multithreaded
  17. 15:18Time to market
  18. 15:41Go is efficient
  19. 17:12Datadriven decisions
  20. 17:25Optimization challenges
  21. 19:55Open source issue on Kubernetes
  22. 22:11Optimizing Kubernetes
  23. 26:12Test Driven Development
  24. 27:05Benchmark Driven Optimization
  25. 28:15Macro Benchmarks
  26. 29:44Benchmark Tool
  27. 32:12Test Data
  28. 33:40Compilation
  29. 34:40Global Variable
  30. 35:14Benchmarks
  31. 36:02Understanding the results
  32. 39:10Finding bottlenecks
  33. 39:54Pprov
  34. 41:14Malloc
  35. 41:31Garbage Collection
  36. 41:52Share Polar Signals
  37. 42:19Memory
  38. 43:08Magic Graph
  39. 43:35Prometheus Process Metric
  40. 43:57Peak
  41. 44:16Collect
  42. 45:44Algorithm Level Optimization
  43. 47:10Complexity
  44. 47:44Cache
  45. 48:52Race
  46. 49:22Single Flight
  47. 50:16Implementation
  48. 50:36Benchstat
  49. 51:03Collect Container Info
  50. 51:28String Slice
  51. 51:43Array Slice
  52. 53:31Preallocate
  53. 55:06Magic values
  54. 55:41Results
  55. 56:02Add Metric
  56. 56:29Debug
  57. 56:40C Advisor
  58. 56:55Client Golang
  59. 57:39Finally
  60. 58:11Documentation
  61. 59:01Pattern
  62. 59:23Summary
  63. 59:38Learning
~/search
type to search 6,249 conferences, 138,987 speakers and 185,172 talks
~/help
cmdctrl k
search every conference, speaker and series
/
focus the filter search
h
home
c
conferences
s
speakers
e
series
t
light / dark — the status bar button does the same
?
this help
esc
close this, then clear every filter — or just the search, while you are typing in it

Ignored while you are typing. Pages without a filter rail have no search to focus.