This directory contains benchmark scripts to test the actor system scalability.
Tests performance on a single node.
mix run scripts/benchmark.exsIncluded tests:
- Creation of 50,000 actors
- 10,000 invocations on the same actor (hot spot)
- Hash ring distribution
- Multi-capability
- Mixed load
- Latency measurement (P50, P95, P99)
Tests distributed performance with multiple Erlang nodes.
NOTE This benchmark needs to be executed in distributed mode:
elixir --name bench@127.0.0.1 --cookie mvp -S mix run scripts/benchmark_multinode.exsDO NOT execute with just mix run, use the complete command above!
Included tests:
- Distributed actor creation
- RPC latency between nodes
- Distributed mixed load
- Resilience (node failure simulation)
- Hash ring balancing
Basic test to verify connectivity between nodes.
elixir --name test@127.0.0.1 --cookie mvp -S mix run scripts/test_multinode.exsStatistical benchmarks using the Benchee library with extended metrics.
mix run scripts/benchee_benchmark.exsIncluded tests:
- Actor creation performance (100, 1k, 5k actors)
- Invocation performance (sequential vs parallel)
- Multi-capability comparison
- Hot spot contention analysis
- Hash ring distribution patterns
Features:
- Extended statistics (median, percentiles, standard deviation)
- Memory profiling per operation
- Comparison mode between scenarios
- Warmup and multiple iterations for accuracy
warning: :slave.start/3 is deprecated
This is normal. The :slave module will be replaced by :peer in OTP 29. For now, it still works perfectly.
[error] Process #PID<...> raised an exception
** (ErlangError) Erlang error: {:exception, {:undef, [{Capabilities, :_update_capabilities_from_remote...
This is normal and expected. During cluster initialization, nodes connect before the application is fully loaded, causing RPC attempts that fail. These errors are captured and do not affect system functionality.
Why it happens:
- Node A and Node B connect
- Capabilities on Node A detects
nodeupfrom Node B - Tries to propagate capabilities via RPC
- But the application is not yet loaded on Node B
- RPC fails with
:undef(function not found) - System ignores and continues normally
After complete initialization, the system works perfectly without errors.
- Creation throughput: ~16,000 actors/s
- Invocation throughput: ~30,000 req/s
- P95 latency: < 100μs
- Memory per actor: ~11 KB
- Success rate: 100%
- Creation throughput: ~8,000 actors/s
- Distributed throughput: ~8,000 req/s
- RPC latency: ~150μs
- Balanced distribution across nodes
- Success rate: >99%