Jump to content
Not connected, Your IP: 216.73.217.14
Sign in to follow this  
3TDoH

Adding packet loss event data to server information in /status API

Recommended Posts

Posted ... (edited)

Right now the only way a script can judge whether or not a server is having issues is to check the text within the "health" key. This is great for understanding if a server is currently dealing with an issue at the exact moment of the check, but it doesn't help for servers that are having repeated instances of packet loss.

This results in any "rank AirVPN servers" script that sorts based on bandwidth and health to always choose the latest server to recover from a high packet loss incident since it'll be using the least amount of its possible bandwidth.

It doesn't seem like a nice idea to recommend users to dogpile onto a server that's already recovering from a network issue so I'd like to request more historical status information to be added to the server API schema.

Compare the data in the API (https://airvpn.org/api/status/) to what's available in the Status Log table at the bottom of every server page. https://airvpn.org/servers/Revati/ That log gives a better picture of the server health over a longer period of time than just "ok" or "warning".

So I'm proposing something like this:

{
    "deprecated_warning": "'ip_entry' and 'ip_entry_alt' are deprecated. Use 'ip_v4_in1' and 'ip_v4_in2' instead.",
    "servers": [
        {
            "public_name": "Achernar",
            "country_name": "Switzerland",
            ... 
            "health": "warning",
            "warning": "Low packet loss",
            // The number of packet loss events for the server over a set time period
            "recent_health_events": 7,
            "status_log": [
                {
                    // Use date string or Unix timestamp
                    "date": YYYY-MM-DDTHH:mm:SSZ,
                    // Duration of packet loss event in seconds
                    "duration": 61,
                    // Amount of packet loss, 100 = 100% loss. Max loss is most useful value IMO
                    "packet_loss": 31
                },                
                {
                    "date": 2026-06-04T02:35:11Z,
                    "duration": 320,
                    "packet_loss": 57 
                }
                ...
            ]
        },
       ... 
    ]
)
 A sliding window slice of events that have happened within 12 or 24 hours for each server would give a quick picture of the ongoing health of a server and allow tools (like the little bash script for gluetun I'm writing) to make better choices and spread out the load.

Even just the "recent_health_events" value with a simple total of the packet loss events over a period of time would be a huge improvement.

This is just a first draft proposal, any naming or implementation specifics would be in the hands of AirVPN developers. So don't get too caught up on naming or structure; this is more about voicing the lack of API information for making better server choices.

EDIT: Small language fixes for readability. Edited ... by 3TDoH

Share this post


Link to post

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
  • Security Check
    Play CAPTCHA Audio
    Refresh Image
Sign in to follow this  

×
×
  • Create New...