Skip to content

Instantly share code, notes, and snippets.

@gabrielfeo
Last active July 11, 2024 14:24
Show Gist options
  • Save gabrielfeo/4023eddfd59ad98e990b90229396fbea to your computer and use it in GitHub Desktop.
Save gabrielfeo/4023eddfd59ad98e990b90229396fbea to your computer and use it in GitHub Desktop.
HTTP benchmarking tools from denji/awesome-http-benchmark, sorted by stars
https://github.com/wg/wrk
https://github.com/loadimpact/k6
https://github.com/tsenart/vegeta
https://github.com/rakyll/hey
https://github.com/ddosify/ddosify
https://github.com/mcollina/autocannon
https://github.com/codesenberg/bombardier
https://github.com/hatoo/oha
https://github.com/giltene/wrk2
https://github.com/six-ddc/plow
https://github.com/nakabonne/ali
https://github.com/istio/fortio
https://github.com/yandex/yandex-tank
https://github.com/PragmaticFlow/NBomber
https://github.com/fcsonline/drill
https://github.com/gophergala2016/goad
https://github.com/shekyan/slowhttptest
https://github.com/hallatore/Netling
https://github.com/httperf/httperf
https://github.com/tsliwowicz/go-wrk
https://github.com/h2non/baloo
https://github.com/rogerwelin/cassowary
https://github.com/tag1consulting/goose
https://github.com/ChillFish8/rewrk
https://github.com/cmpxchg16/gobench
https://github.com/tarekziade/molotov
https://github.com/bengadbois/pewpew
https://github.com/lubia/sniper
https://github.com/valyala/goloris
https://github.com/lighttpd/weighttp
https://github.com/ikruglov/slapper
https://github.com/BuoyantIO/slow_cooker
https://github.com/apigee/apib
https://github.com/americanexpress/baton
https://github.com/facebookincubator/fbender
https://github.com/parkghost/gohttpbench
https://github.com/gonetx/httpit
https://github.com/tarekziade/salvo
https://github.com/utkusen/reqstress
https://github.com/hagen1778/fasthttploader
https://github.com/ajmwagar/lor-axe
https://github.com/arut/htstress
https://github.com/rylev/welle
https://github.com/byorty/mgun
https://github.com/opsengine/inundator
https://github.com/folkertvanheusden/httping
https://github.com/fredrikwidlund/pounce
https://github.com/TylerBrock/thrash
http://en.wikipedia.org/wiki/ApacheBench
https://bencher.dev/
http://curl-loader.sourceforge.net/
http://gatling.io
https://nghttp2.org/documentation/h2load-howto.html
http://jmeter.apache.org/
https://locust.io/
http://www.joedog.org/siege-home/
http://tsung.erlang-projects.org/
@gabrielfeo
Copy link
Author

gabrielfeo commented Jul 11, 2024

The repos from denji/awesome-http-benchmark, sorted by GitHub stars. Non-GitHub tools in the end.

From a GPT-generated script:

import requests
import sys
import re
import time
import os

# Function to extract GitHub repo owner and name from URL
def extract_repo_info(repo_url):
    match = re.match(r'https://github\.com/([^/]+)/([^/]+)', repo_url)
    if match:
        return match.groups()
    return None, None

# Function to get the star count of a GitHub repository
def get_repo_info(repo_url, headers):
    owner, repo = extract_repo_info(repo_url)
    if not owner or not repo:
        return None, repo_url

    api_url = f'https://api.github.com/repos/{owner}/{repo}'
    try:
        response = requests.get(api_url, headers=headers)
        response.raise_for_status()
        data = response.json()
        return data['stargazers_count'], repo_url
    except requests.exceptions.HTTPError as e:
        if response.status_code == 403 and 'X-RateLimit-Reset' in response.headers:
            reset_time = int(response.headers['X-RateLimit-Reset'])
            sleep_time = max(0, reset_time - int(time.time()))
            print(f"Rate limit exceeded. Sleeping for {sleep_time} seconds.", file=sys.stderr)
            time.sleep(sleep_time + 1)
            return get_repo_info(repo_url, headers)
        print(f"Error fetching data for {repo_url}: {e}", file=sys.stderr)
        return None, repo_url

if __name__ == "__main__":
    # Get the GitHub token from environment variables
    token = os.getenv('GITHUB_TOKEN')
    if not token:
        print("Error: GITHUB_TOKEN environment variable is not set.", file=sys.stderr)
        sys.exit(1)

    # GitHub API headers with authentication
    headers = {'Authorization': f'token {token}'}

    # Read URLs from stdin
    repo_urls = [line.strip() for line in sys.stdin]

    # Initialize lists for sorted and excluded URLs
    sorted_repos = []
    excluded_urls = []

    # Get star counts for each repository
    for url in repo_urls:
        if 'github.com' in url:
            stars, repo_url = get_repo_info(url, headers)
            if stars is not None:
                sorted_repos.append((stars, repo_url))
            else:
                excluded_urls.append(url)
        else:
            excluded_urls.append(url)

    # Sort repositories by star count in descending order
    sorted_repos = sorted(sorted_repos, key=lambda x: x[0], reverse=True)

    # Print the sorted URLs
    for stars, url in sorted_repos:
        print(url)

    # Print the excluded URLs in their original order
    for url in excluded_urls:
        print(url)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment