Skip to content

fsbraun/django-cms-benchmark

 
 

Repository files navigation

pythonapp

django CMS benchmark

A dockerised django CMS project to benchmark performance for large installations.

This project is based on the django CMS quickstart and add a benchmark app.

Benchmarks are run on the existing database by typing:

docker compose run web python manage.py test

Installation

You need to have Docker installed on your system to run this project.

Try it

git clone [email protected]:django-cms/django-cms-quickstart.git
cd django-cms-quickstart
docker compose build web
docker compose up -d database_default
docker compose run web python manage.py migrate
docker compose run web python manage.py createsuperuser
docker compose up -d

Then open http://127.0.0.1:8000 in your browser.

You can stop the server with docker compose stop without destroying the containers and restart it with docker compose start.

With docker compose down the containers are deleted, but the database content is still preserved in the named volume django-cms-quickstart_postgres-data and the media files are stored in the file system in data/media. Then you can update the project e. g. by changing the requirements and settings. Finally you can rebuild the web image and start the server again:

docker compose build web
docker compose up -d

Creating pages

The management command ./manage.py create_pages creates an (empty) page tree of well-nested 19166 pages. Run repeatedly to create more pages.

Example results

 Found 4 test(s).
 System check identified no issues (0 silenced).
 Total pages: 57498
 ------------------
  .Build nodes.
 -------------
 Total nodes:        57498
 Total queries:      8
 Total process time: 1891ms
 Total time (cache):  381ms

.Show menu (nodes are cached).
 ------------------------------
 Total process time: 351ms
 Calls cut_levels:   6
 Queries:            1
 Generated menu size:8kB

 .Show page preview including menu.
 ----------------------------------
 Total time:         2273ms
 Calls cut_levels:   6
 Queries:            21

 .
 ----------------------------------------------------------------------
 Ran 4 tests in 8.473s

 OK
 django-cms-benchmark % docker compose run web python manage.py test benchmark.tests
 Found 4 test(s).
 System check identified no issues (0 silenced).
 Total pages: 57498
 ------------------
 .Build nodes.
 -------------
 Total nodes:        57498
 Total queries:      10
 Total process time: 1716ms
 Total time (cache): 45.53

 .Show menu (nodes are cached).
 ------------------------------
 Total process time: 388ms
 Calls cut_levels:   6
 Queries:            1
 Generated menu size:8kB

 .Show page preview including menu.
 ----------------------------------
 Total time:         2293ms
 Calls cut_levels:   6
 Queries:            21

 .
 ----------------------------------------------------------------------
 Ran 4 tests in 8.661s

 OK

About

A simple django CMS project with benchmarks, based on django-cms-quickstart

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 76.8%
  • HTML 22.2%
  • Dockerfile 1.0%