perlsky is a Perl 5 implementation of an AT Protocol Personal Data Server.
Performance#
This document covers two practical tools for perlsky performance work:
- Prometheus metrics for live visibility
script/benchmark-local-appviewfor repeatable local endpoint timing
Benchmark Script#
script/benchmark-local-appview spins up an ephemeral local perlsky daemon, seeds a small repo with posts and a reply chain, then benchmarks the hottest local appview endpoints over real HTTP:
app.bsky.actor.getProfileapp.bsky.feed.getAuthorFeedapp.bsky.feed.getPostThread
Example:
script/benchmark-local-appview --iterations 75 --warmup 15 --posts 100 --replies 12
JSON output:
script/benchmark-local-appview --format json > data/local-appview-benchmark.json
The benchmark is intentionally small and deterministic. It is best for comparing one local appview change against another, not for claiming cluster-scale throughput.
Useful flags:
--iterations N: measured requests per endpoint, default50--warmup N: unmeasured warmup requests per endpoint, default10--posts N: number of posts to seed for the author feed, default50--replies N: length of the reply chain for the thread benchmark, default8--feed-limit N:getAuthorFeedpage size, default25--keep-tmp: keep the temporary benchmark dataset on disk for inspection
The script also prints a metrics excerpt so it is easy to sanity-check whether local appview cache counters moved during the run.
Recommended Workflow#
For repeatable tuning:
- Run the benchmark script before a perf change and save the output.
- Apply the change.
- Run the same benchmark again with the same arguments.
- Compare:
p50p95max- derived
req/s
- Check
/metricsto confirm that cache hit/rebuild counters changed the way you expected. - If the change looks promising, compare the same Prometheus panels in Grafana after deployment.
Current Hot Metrics#
The most relevant local appview metrics are:
perlsky_service_proxy_requests_totalperlsky_service_proxy_request_duration_secondsperlsky_service_proxy_local_post_index_cache_access_totalperlsky_service_proxy_local_post_index_rebuild_duration_secondsperlsky_service_proxy_local_post_index_entriesperlsky_service_proxy_local_post_resolution_totalperlsky_service_proxy_profile_record_cache_totalperlsky_repo_resolution_total
See METRICS.md for Prometheus and Grafana queries.