Company
Date Published
Author
Kamal Marhubi
Word count
2273
Language
English
Hacker News points
None

Summary

Heap Engineering discovered that their database machines were spending excessive CPU time on time-related system calls, particularly due to the default xen clocksource on EC2 instances. By switching to the tsc clocksource, which utilizes the fast path for timing calls in userspace and avoids the costly kernel mode switch, they managed to reduce their 95th percentile query times by 30%. This clocksource change was deemed safe after confirming that the i3 instance type's Xeon processors and their virtualization setup did not suffer from potential backward clock drift issues typically associated with the tsc clocksource. The article suggests checking and switching clocksources as a potential performance optimization and briefly discusses the improvements brought by EC2's transition to the Nitro hypervisor, which supports a more efficient clocksource by default.