Cross-border connection speed

  • #it

Recently, I started to notice massive slowdown in connection speeds between me (Samara) and German, French, Dutch servers.

This happens in the evening (UTC +4), when people in European Russia use internet more actively.

During slowdowns, speedtest and iperf show slow connection speeds to a variety of European servers (although, sometimes iperf speed are OK). Some websites become less useful.

I decided to write a crude test script to confirm the hypothesis on correlation between slowdowns and MSK-IX traffic volumes. The script downloads a file from my server in Frankfurt and records timings in CSV file.

import argparse
import csv
import datetime

import warnings
warnings.filterwarnings("ignore")

import requests

from time import sleep


parser = argparse.ArgumentParser(prog='Periodic DL perf test', description='Tests network performance by downloading file from specified URL')

parser.add_argument('url')

parser.add_argument('-t', '--interval', help='Interval between tests in minutes (may be float or int)')
parser.add_argument('-o', '--output', default='log.csv', help='Name of the CSV file for test result logging')
parser.add_argument('-i', '--ignore-ssl', action='store_true', help='If set, SSL certificate errors will be ignored')
args = parser.parse_args()

sleep_interval = int(args.interval) * 60

log_file = open(args.output, 'a')

log_writer = csv.writer(log_file, dialect='excel')

while True:
    start = datetime.datetime.now()
    try:
        length = len(requests.get(args.url, verify=(not args.ignore_ssl)).content)
        end = datetime.datetime.now()
        time_taken = (end - start).total_seconds()
        print('Downloaded ' + str(length) + ' bytes in ' + str(time_taken) + ' seconds')
    except:
        time_taken = -1.0
        print("Failed to download file")
        end = datetime.datetime.now()
        length = -1

    log_writer.writerow([start.strftime("%Y-%m-%d %H:%M:%S"), end.strftime("%Y-%m-%d %H:%M:%S"), time_taken, length])
    log_file.flush()
    interval = max(1.0, sleep_interval - time_taken)
    print("Sleeping", interval, "seconds")
    sleep(interval)

After 24h of continuous measurements I plotted graphs in MS Excel:

Graphs showcasing measurement results.

As you can clearly see, the during during peak traffic periods on MSK-IX average download time rises substantially. In addition, a lot of anomalies happen: download errors and very slow DL speed.

I will perform some other tests in the near future to determine if this slowdowns are caused by bandwidth limits at exchange points or not.

Looks like (just maybe) you are enjoying my content. Check out settings to subscribe to push-notifications or allow collections of some analytical data that helps to improve this website and its content.

Go to settings