Skip to content

Instantly share code, notes, and snippets.

@deepakdinesh1123
Last active June 13, 2023 10:43
Show Gist options
  • Star 3 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save deepakdinesh1123/58d91e292533746017e3568c5a3f374f to your computer and use it in GitHub Desktop.
Save deepakdinesh1123/58d91e292533746017e3568c5a3f374f to your computer and use it in GitHub Desktop.
Google Summer Of Code 2022 Final Work Submission Report

Google Summer of Code 2022 Final Work Submission Report

Project Goals

  • Integrate the Airspeed Velocity benchmarking package into djangobench and run the benchmarks regularly
  • Create a test harness using Locust and load-test different WSGI servers and ASGI servers to determine the effects of using ASGI instead of WSGI
  • Write new benchmarks aimed at benchmarking the request-response cycle
  • Create a template repository that can be used to add sample django projects and perform load-test using Locust
  • Update the loadtest project in the Channels repository and use Locust to perform load-tests

Project Goals Achieved

  • Merged Pull Requests

    • Integrating Airspeed Velocity

      Airspeed Velocity (asv) is a tool for benchmarking Python packages over their lifetime. Runtime, memory consumption, and even custom-computed values may be tracked. The results are displayed in an interactive web frontend that requires only a basic static webserver to host.

      My mentor David Smith had already worked on integrating the airspeed velocity package into djangobench to make the benchmarking process more robust, I picked up his work by refactoring the existing benchmarks in the Pull requests

      #11, #12, #13, #14, #20, #25

      Some of the benchmarks in djangobench had not yet been migrated, so I migrated them

      #21, #22, #23, #24, #26, #27, #28, #29, #30, #32, #33, #36

      The result of the integration of Airspeed Velocity with djangobench can be seen in the django-asv repository.

    • Running the benchmarks regularly and publishing results to a website

      Authored Github workflows in the django-asv repository to run the benchmarks regularly and commit the results back to the repository and publish the result to a website using Github pages

      The results of benchmarks are published to a website -

      Screenshot (55)

    • Run the benchmarks on a pull request when it is labeled with the label "benchmark"

      To run the benchmarks on a pull request so that performance issues can be identified before it is merged, my mentors suggested I add a workflow to run the benchmarks when a pull request made to the django repository was labeled with the label 'benchmark'.

      PR - Workflow to run the ASV benchmarks for labeled PR

    • Adding new benchmarks aimed at benchmarking the request-response cycle

      In this pull request PR - #65 I added new benchmarks to benchmark the request-response cycle.

  • Work Under Review

    • Template to perform load-testing on a Django project with different ASGI and WSSGI servers

      Load testing was being performed by containerizing a Django project using Docker and then load-testing them using Locust, since many of the files being used to load test two different projects were similar my mentor Carlton Gibson suggested I create a template repository with the necessary files so that users can add other projects or use the template to perform load-testing easily

      Template repository to perform load testing

    • Updating the load-testing project in the Channels repository

      An issue in the channels project pointed out the load-testing results had not been updated for a long time. I updated the load-testing project to use the Locust library to perform load-testing. This project is still being reviewed and I will add it to the channels repository later.

      Channels load testing project

    • Create a test harness using Locust to load test different ASGI and WSGI servers

      Using Docker I containerized Django projects having Django installed directly from pull requests and running on different ASGI and WSGI servers. Then I used Locust to create a test harness and was able to perform load testing on different servers to determine the effects of the said pull request on the performance

      Django - PR#14652

      Django - PR#15727

Future Work

  • Perform load-testing on ticket #32172
  • Work on improving the template repository for load testing
  • Work on improving the channels loadtest project

I would like to thank my mentors Carlton Gibson and David Smith for guiding me every step of the way and helping me complete my project successfully. Because of them, I was able to learn a lot about open-source contributions and Django.

Links:

@dkshsingh
Copy link

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