Skip to content

wireguard-config-benchmark is a python script that benchmarks the download speeds for the connections defined in one or more wireguard config files. If multiple configs are benchmarked it will output a file ranking them from fastest to slowest.

License

vorlac/wireguard-config-benchmark

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Setup

  1. Install Wireguard, along with any additional dependencies
  2. Install Puthon 3.x
  3. Run the following command to install all python package script dependencies
    pip install -r requirements.txt
  4. Generate wireguard config files from your VPN provider

How to run the benchmark script

  1. Open benchmark_wireguard_vpn_servers.py and edit the VPN_CONFIG_DIR variable defined at the top to point to the directory containing all wireguard config files.

  2. Run the script:

    • Windows note: admin privelages are required in order to make calls to the wireguard client from within the script
      python benchmark_wireguard_vpn_servers.py

    The script will pipe all stdout output to a file named benchmark_stdout.txt

    When the script has finished benchmarking all wireguard configs, it will write the results to a file named benchmark_results.json. This file will be sorted by download speed in descending order and will include information about each config tested (config name, server information, and speedtest information).

Example benchmark_results.json output file

[
    {
        "name": "<config-file-name-1>",
        "ip": "<vpn-server-ip>",
        "city": "<vpn-server-city-name>",
        "region": "<vpn-server-region/state-name>",
        "country": "<vpn-server-country-name>",
        "coordinate": [
            -123.45,
            67.890
        ],
        "speedtest_results": [
            {
                "server_name": "Speedtest Server 1 Name (Speedtest Server City, State/Region, Country) [Distance from VPN server]",
                "server_id": "12345",
                "upload_speed": 0.0,
                "download_speed": 500.00,
                "ping": 10.000
            },
            {
                "server_name": "Speedtest Server 2 Name (Speedtest Server City, State/Region, Country) [Distance from VPN server]",
                "server_id": "12346",
                "upload_speed": 0.0,
                "download_speed": 400.00,
                "ping": 10.000
            },
            {
                "server_name": "Speedtest Server 3 Name (Speedtest Server City, State/Region, Country) [Distance from VPN server]",
                "server_id": "12347",
                "upload_speed": 0.0,
                "download_speed": 300.00,
                "ping": 10.000
            },
            {
                "server_name": "Speedtest Server 4 Name (Speedtest Server City, State/Region, Country) [Distance from VPN server]",
                "server_id": "12348",
                "upload_speed": 0.0,
                "download_speed": 200.00,
                "ping": 10.000
            },
            {
                "server_name": "Speedtest Server 5 Name (Speedtest Server City, State/Region, Country) [Distance from VPN server]",
                "server_id": "12349",
                "upload_speed": 0.0,
                "download_speed": 100.00,
                "ping": 10.000
            }
        ]
    },
    {
        "name": "<config-file-name-2>",
        "ip": "<vpn-server-ip>",
        "city": "<vpn-server-city-name>",
        "region": "<vpn-server-region/state-name>",
        "country": "<vpn-server-country-name>",
        "coordinate": [
            -123.45,
            67.890
        ],
        "speedtest_results": [
            {
                "server_name": "Speedtest Server 1 Name (Speedtest Server City, State/Region, Country) [Distance from VPN server]",
                "server_id": "12345",
                "upload_speed": 0.0,
                "download_speed": 125.00,
                "ping": 10.000
            },
            {
                "server_name": "Speedtest Server 2 Name (Speedtest Server City, State/Region, Country) [Distance from VPN server]",
                "server_id": "12346",
                "upload_speed": 0.0,
                "download_speed": 120.00,
                "ping": 10.000
            },
            {
                "server_name": "Speedtest Server 3 Name (Speedtest Server City, State/Region, Country) [Distance from VPN server]",
                "server_id": "12347",
                "upload_speed": 0.0,
                "download_speed": 115.00,
                "ping": 10.000
            },
            {
                "server_name": "Speedtest Server 4 Name (Speedtest Server City, State/Region, Country) [Distance from VPN server]",
                "server_id": "12348",
                "upload_speed": 0.0,
                "download_speed": 110.00,
                "ping": 10.000
            },
            {
                "server_name": "Speedtest Server 5 Name (Speedtest Server City, State/Region, Country) [Distance from VPN server]",
                "server_id": "12349",
                "upload_speed": 0.0,
                "download_speed": 105.00,
                "ping": 10.000
            }
        ]
    }
]

About

wireguard-config-benchmark is a python script that benchmarks the download speeds for the connections defined in one or more wireguard config files. If multiple configs are benchmarked it will output a file ranking them from fastest to slowest.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages