At Ordo One, we’vebeen using perf_events + FlameGraph for a number of years to investigate Swift performance on Linux, but the manual sampling approach has limitations - you need to know when and what to profile, making it reactive rather than proactive.
The industry has shifted towards always-on, low-overhead profiling (<1%) that captures performance data continuously without manual intervention. Continuous profiling provides a historical record, allowing you to investigate performance issues that occurred even when you weren't looking at the correct time.
We have picked Parca and packaged a solution for Swift profiling: swift-parca.
With just two docker compose commands, you can get continuous profiling in your Swift on Server large-scale production environments (or on your Linux VM running on Apple silicon).
This is really cool. Parca in general looks pretty awesome.
I See in your Dockerfile, that you tried to build a static binary for addr2line-swift Would that be an option? I would want to avoid having to run the full swift:slim image to host the parca server (we have mostly Java workloads in the cluster)…
Yes, there was an issue that need to make changes to try to get the demangle function to be present in the static build, currently it tries to be loaded and fails:
nobody@4f04490f27b7:/$ /usr/local/bin/addr2line-swift
Warning: swift_demangle symbol not foundFailed to load swift_demangle
nobody@4f04490f27b7:/$ du -sh /usr/local/bin/addr2line-swift
137M /usr/local/bin/addr2line-swift
The Swift runtime is only needed on the Parca server to demangle Swift symbols, no need to make changes on the cluster which is running the Java workloads.