Skip to main content

Benchmarks

This document presents the benchmark results for edgeProxy with WireGuard overlay network across global locations.

Infrastructure Setup

For details on how to set up the AWS EC2 and WireGuard infrastructure used in these tests, see AWS EC2 Deployment.


Benchmark v3 (Current) - WireGuard Full Meshโ€‹

Significant Improvement

After migrating from hub-and-spoke to full mesh, APAC latency improved by ~2x.

Test Infrastructureโ€‹

ComponentDetails
POPGCP Hong Kong (asia-east2)
IP35.241.112.61:8080
Regionap (Asia Pacific)
Backends10 (via WireGuard full mesh)
TopologyFull mesh (HKG connects directly to NRT/SIN/SYD)

Test Results (Full Mesh)โ€‹

#VPN LocationCountryBackendHostLatencyBefore (Hub)Improvement
1-3๐Ÿ‡จ๐Ÿ‡ณ๐Ÿ‡ญ๐Ÿ‡ฐ China/HKCN/HKHKG---โญ๏ธ (local POP)
4๐Ÿ‡ฏ๐Ÿ‡ต TokyoJPNRT08016e2f~760ms1.79s2.3x
5๐Ÿ‡ธ๐Ÿ‡ฌ SingaporeSGSIN6837391c~895ms1.63s1.8x
6๐Ÿ‡น๐Ÿ‡ผ TaiwanTWNRT08016e2f~753ms1.64s2.2x
7๐Ÿ‡ฐ๐Ÿ‡ท SeoulKRSIN6837391c~800ms1.71s2.1x
8๐Ÿ‡ฎ๐Ÿ‡ณ IndiaINIAD-timeout*1.58s-
9๐Ÿ‡ฆ๐Ÿ‡บ SydneyAUSYD-~1.0s**1.94s~2x

*VPN timeout during test **Estimated based on mesh latency

Geo-routing accuracy: 6/6 (100%)

WireGuard Mesh Latency (from HKG)โ€‹

Before (Hub-and-Spoke via EC2 Ireland)โ€‹

BackendWireGuard IPPing Latency
EC2 Ireland (Hub)10.50.0.1242ms
NRT (Tokyo)10.50.4.1492ms
SIN (Singapore)10.50.4.2408ms
SYD (Sydney)10.50.4.3~500ms

After (Direct Full Mesh)โ€‹

BackendWireGuard IPPing LatencyImprovement
NRT (Tokyo)10.50.4.149ms10x
SIN (Singapore)10.50.4.238ms10.7x
SYD (Sydney)10.50.4.3122ms~4x

Full Mesh Configurationโ€‹

The HKG POP now connects directly to APAC backends without going through EC2 Ireland hub:

# HKG WireGuard config (/etc/wireguard/wg0.conf)
[Interface]
PrivateKey = <HKG_PRIVATE_KEY>
Address = 10.50.5.1/24
ListenPort = 51820

# EC2 Ireland (for non-APAC backends)
[Peer]
PublicKey = bzM6rw/efq+75VGhBgkCRChDnKfFlXQY560ejhvKCQY=
Endpoint = 54.171.48.207:51820
AllowedIPs = 10.50.0.1/32, 10.50.1.0/24, 10.50.2.0/24, 10.50.3.0/24
PersistentKeepalive = 25

# NRT - Tokyo (direct mesh)
[Peer]
PublicKey = 9ZK9FzSzihxrRX9gktc99Oj0WFSJMa0mf33pP2LJ/lU=
AllowedIPs = 10.50.4.1/32
PersistentKeepalive = 25

# SIN - Singapore (direct mesh)
[Peer]
PublicKey = gcwoqaT950PGW1ZaUEV75VEV7HOdyYT5rwdYOUBQzR0=
AllowedIPs = 10.50.4.2/32
PersistentKeepalive = 25

# SYD - Sydney (direct mesh)
[Peer]
PublicKey = 9yHQmzbLKEyM+F1x7obbX0WNaR25XhAcUOdU9SLBeEo=
AllowedIPs = 10.50.4.3/32
PersistentKeepalive = 25

Running v3 Testsโ€‹

# Test connectivity to HKG POP
nc -zv 35.241.112.61 8080

# Quick latency test
for i in {1..10}; do
curl -w "%{time_total}s\n" -o /dev/null -s http://35.241.112.61:8080/api/latency
done

# Check geo-routing (now includes hostname)
curl -s http://35.241.112.61:8080/api/info | jq .
# Returns: {"hostname":"08016e2f","region":"nrt","region_name":"Tokyo, Japan",...}

v3 Observationsโ€‹

  • Full mesh reduces APAC latency by ~2x compared to hub-and-spoke
  • HKG connects directly to NRT/SIN/SYD (38-122ms) instead of through EC2 Ireland (400-500ms)
  • All APAC traffic correctly routed to nearest regional backend
  • Taiwan and Korea route to nearest APAC backend
  • India routes to IAD (Virginia) - no closer APAC backend
  • hostname now visible in responses to identify which VM is responding

Benchmark v2โ€‹

Test Resultsโ€‹

#VPN LocationCountryBackendLatencyDownload 1MBDownload 5MBRPS (20)Status
1๐Ÿ‡ซ๐Ÿ‡ท ParisFRCDG530ms0.5 MB/s2.1 MB/s35.7โœ…
2๐Ÿ‡ฉ๐Ÿ‡ช FrankfurtDEFRA528ms0.6 MB/s2.3 MB/s34.0โœ…
3๐Ÿ‡ฌ๐Ÿ‡ง LondonGBLHR490ms0.6 MB/s2.3 MB/s36.6โœ…
4๐Ÿ‡บ๐Ÿ‡ธ DetroitUSIAD708ms0.6 MB/s2.5 MB/s27.4โœ…
5๐Ÿ‡บ๐Ÿ‡ธ Las VegasUSIAD857ms0.5 MB/s2.2 MB/s22.5โœ…
6๐Ÿ‡ฏ๐Ÿ‡ต TokyoJPNRT1546ms0.3 MB/s1.1 MB/s12.6โœ…
7๐Ÿ‡ธ๐Ÿ‡ฌ SingaporeSGSIN1414ms0.3 MB/s1.2 MB/s13.8โœ…
8๐Ÿ‡ฆ๐Ÿ‡บ SydneyAUSYD1847ms0.2 MB/s0.9 MB/s10.7โœ…
9๐Ÿ‡ง๐Ÿ‡ท Sao PauloBRGRU822ms0.4 MB/s1.6 MB/s23.3โœ…

Performance by Regionโ€‹

RegionLatencyObservation
๐Ÿ‡ช๐Ÿ‡บ Europe (CDG/FRA/LHR)490-530msBest - closest to EC2 Ireland
๐Ÿ‡บ๐Ÿ‡ธ USA (IAD)708-857msMedium - crosses Atlantic
๐Ÿ‡ง๐Ÿ‡ท Brazil (GRU)822msGood - direct route
๐Ÿ‡ฏ๐Ÿ‡ต๐Ÿ‡ธ๐Ÿ‡ฌ Asia (NRT/SIN)1414-1546msHigh - geographic distance
๐Ÿ‡ฆ๐Ÿ‡บ Oceania (SYD)1847msHighest - half way around the world

Test Architectureโ€‹

Benchmark Architecture


Geo-Routing Validationโ€‹

All 9 VPN tests correctly routed to the expected backend:

Client LocationExpectedActualResult
๐Ÿ‡ซ๐Ÿ‡ท FranceCDGCDGโœ…
๐Ÿ‡ฉ๐Ÿ‡ช GermanyFRAFRAโœ…
๐Ÿ‡ฌ๐Ÿ‡ง United KingdomLHRLHRโœ…
๐Ÿ‡บ๐Ÿ‡ธ United StatesIADIADโœ…
๐Ÿ‡ฏ๐Ÿ‡ต JapanNRTNRTโœ…
๐Ÿ‡ธ๐Ÿ‡ฌ SingaporeSINSINโœ…
๐Ÿ‡ฆ๐Ÿ‡บ AustraliaSYDSYDโœ…
๐Ÿ‡ง๐Ÿ‡ท BrazilGRUGRUโœ…

Running Your Own Testsโ€‹

Quick Latency Testโ€‹

for i in {1..10}; do
curl -w "%{time_total}s\n" -o /dev/null -s http://54.171.48.207:8080/api/latency
done

Check Geo-Routingโ€‹

curl -s http://54.171.48.207:8080/api/info | jq .
# Returns: {"region":"cdg","region_name":"Paris, France",...}

Download Speed Testโ€‹

# 1MB download
curl -w "Speed: %{speed_download} B/s\n" -o /dev/null -s \
"http://54.171.48.207:8080/api/download?size=1048576"

# 5MB download
curl -w "Speed: %{speed_download} B/s\n" -o /dev/null -s \
"http://54.171.48.207:8080/api/download?size=5242880"

Complete Benchmark Scriptโ€‹

Use the provided script in scripts/benchmark.sh:

./scripts/benchmark.sh http://54.171.48.207:8080

Benchmark Endpointsโ€‹

EndpointDescription
/ASCII art banner with region info
/api/infoJSON server info (region, uptime, requests)
/api/latencyMinimal response for latency testing
/api/download?size=NDownload test (N bytes, max 100MB)
/api/uploadUpload test (POST body)
/api/statsServer statistics
/benchmarkInteractive HTML benchmark page

Conclusionsโ€‹

  1. Geo-Routing: 100% accuracy routing clients to correct regional backend
  2. WireGuard: Stable tunnels with all 10 global backends
  3. Performance: Latency scales predictably with geographic distance
  4. Reliability: All tests passed with consistent results

Production Deploymentโ€‹

For production, deploy edgeProxy POPs in multiple regions:

ScenarioExpected Latency
Client โ†’ Local POP โ†’ Local Backend5-20ms
Client โ†’ Local POP โ†’ Regional Backend20-50ms
Client โ†’ Local POP โ†’ Remote Backend50-150ms

The test setup routes all traffic through Ireland. A full mesh deployment would significantly improve global performance.


Benchmark v1 (Initial)โ€‹

Initial validation test with limited regions to verify geo-routing functionality.

Test Scope
  • Regions tested: 3 (Europe focus)
  • Purpose: Validate basic geo-routing and WireGuard connectivity

Test Resultsโ€‹

#VPN LocationCountryBackendLatencyStatus
1๐Ÿ‡ซ๐Ÿ‡ท ParisFRCDG~500msโœ…
2๐Ÿ‡ฉ๐Ÿ‡ช FrankfurtDEFRA~520msโœ…
3๐Ÿ‡ฌ๐Ÿ‡ง LondonGBLHR~480msโœ…

v1 โ†’ v2 Improvementsโ€‹

Aspectv1v2
Regions tested39
MetricsLatency onlyLatency, Download, RPS
Global coverageEurope only5 continents
WireGuard peers310