~/talk

Python profiling and performance tuning in production

Talkat PyCon Canada 2017 · 2017-11-18..11-21· [web-performance]
links:none on file
slides:none on file

Pinterest cuts front-end latency and fleet size by over 40% fleet reduction using under 100 lines of Python, after finding 70% of latency comes from mixing CPU work with gevent cooperative multitasking. Diagnosis uses cProfile call graphs, line_profiler, a SIGVTALRM-based statistical sampler (stack-sampling converted to flame graphs) and Improv for statistical line hits. Production sampling runs ~15 minutes per process, targets a 33% increase in requests per host, and yields the reported 30–40% cost and latency wins.

AI-written summary · about

  1. 0:00Introduction and context
  2. 1:05Problem with high latency
  3. 2:10Gevent and cooperative multitasking
  4. 5:38Demo of latency degradation
  5. 8:47Impact of blocking calls
  6. 10:08Reducing CPU usage in API
  7. 11:30Profiling tools overview
  8. 12:14CProfile API profiler
  9. 14:40Line profiler for CPU bottlenecks
  10. 16:45Statistical profilers
  11. 18:31Stack sampler and flame graphs
  12. 20:58Improv statistical line profiling
  13. 22:00Production profiling setup
  14. 23:23Case study deep copy removal
  15. 25:11Detecting regressions visually
  16. 26:12Results and conclusion
~/search
type to search 8,222 conferences, 162,397 speakers and 219,688 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
← →
on a talk: 5 seconds back / forward
0–9
on a talk: jump to 0%–90% of the recording
?
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.