eBPF Can Do It! A 5-Minute Tour of 5 Real-World PHP Issues Solved with eBPF
- What is eBPF?
- Cases
- #1 Memcached Performance Issue Diagnosis
- #2 Dead Code Detection
- #3 Inspecting C extension behavior
- #4 Measuring the time taken for legacy batch jobs
- #5 Long-Term Internal Metrics
- Recap
Performance Issue Diagnosis • #2 Dead Code Detection • #3 Inspecting C extension behavior • #4 Measuring the time taken for legacy batch jobs • #5 Long-Term Internal Metrics • Recap
Slow deployment process • Extremely hard to tell whether code is actually unused • Not only web but also batch jobs, etc. • Some jobs might run once a month or more
is enough memory available • We hit this issue in some apps in production, caused issues like hitting old cache • apcu_store should return false on failure
required contiguous free memory space, but the implementation was only checking the total available size rather than verifying that a contiguous block was actually available3 • This meant APCu could determine there was sufficient space and proceed with the store operation, only to fail afterward when no contiguous region large enough was available. • This issue has been fixed in v5.1.25. • Use fixed version! 3 https://github.com/krakjoe/apcu/pull/532
A App / API Batch jobs DB Low latency (co-located) Migrating During migration to location B Network location A App / API Batch jobs Network location B (target) DB +1.6 ms latency
A App / API Batch jobs DB TC command inject delay Co-located: delay added artificially to simulate the move Migrating During migration to location B Network location A App / API Batch jobs Network location B (target) DB +1.6 ms latency