tomdyson / django-sqlite-load-tests

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Demo Wagtail app for load testing SQLite

Installation

Set up Wagtail

python3 -m venv venv
source venv/bin/activate
pip install -r requirements.txt
./manage.py migrate
./manage.py createsuperuser

Download 35k film plots and load them into the database:

python fetch.py https://tomd.org/x/wiki_movie_plots_deduped.csv.gz
gunzip wiki_movie_plots_deduped.csv.gz
./manage.py importfilms

Run locally with Gunicorn:

gunicorn wagtailfilms.wsgi:application

Load testing

# Install wrk
brew install wrk
# Run 5 threads for 5 seconds, read-only
wrk -c5 -d5 -t5 http://127.0.0.1:8000/films/the-test-of-honor/
# Run 5 threads for 5 seconds, read-write
wrk -c5 -d5 -t5 http://127.0.0.1:8000/films/update/

About


Languages

Language:Python 53.0%Language:HTML 37.2%Language:CSS 7.9%Language:Dockerfile 1.9%