Coder Social home page Coder Social logo

c-w / python-loadtests Goto Github PK

View Code? Open in Web Editor NEW
2.0 1.0 0.0 44 KB

Performance benchmarks and setup-complexity comparison for Sanic, Flask, Connexion and Django

License: Apache License 2.0

Python 53.20% Shell 46.80%
sanic django flask connexion python3 locustio

python-loadtests's Introduction

Python loadtests

This repository contains sample apps and server setup scripts for a variety of Python web stacks:

  • Sanic with Authbind
  • Flask (behind gUnicorn and Nginx)
  • Django (behind Apache)
  • Connexion (behind Tornado and Nginx)

There is also a companion talk for this repository that I gave at the Code & Coffee Meetup in Vancouver.

For each of these stacks, we then run a load-test that consists of a network-bound task and a framework-bound task.

Authbind + Sanic is the easiest stack to set up and is competitive performance-wise with more complicated stacks.

Benchmarks of Sanic versus Flask, Connexion and Django

To reproduce these results, first set up a server for each of the web stacks using the setup scripts:

stack_type=sanic_authbind  # or connexion_tornado_nginx or django_modwsgi_apache or flask_gunicorn_nginx
curl -O https://raw.githubusercontent.com/c-w/python-loadtests/master/${stack_type}/setup.sh | bash -s my-azure-storage-account my-azure-storage-key

Now on a seperate driver machine, set up the data store for the network-bound task and then run the load test:

curl -O https://raw.githubusercontent.com/c-w/python-loadtests/master/shared/setup.sh | bash
py_env/bin/python3 setup_azure_tables.py --account=my-azure-storage-account --key=my-azure-storage-key

test_type=SanicTest  # or ConnexionTest or DjangoTest or FlaskTest
py_env/bin/locust ${test_type} --only-summary --no-web --clients=500 --hatch-rate=50  # let run for a while, then hit ctrl+c to see results

python-loadtests's People

Contributors

c-w avatar

Stargazers

 avatar  avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.