This project was built to benchmark various serializers used in context of HTTP requests. We compare JSON vs. Protobufs vs. MessagePack running on a Flask service.
- pip
- virtualenv & virtualenvwrapper
- python 2.7.10
-
Create virtual environment
mkvirtualenv message_serializers
-
Activate virtualenv
workon message_serializers
-
Install project requirements
pip install -r requirements.txt
-
Run Flask server
sh run_server.sh
-
Open a new terminal in the same project folder
-
Activate virtualenv
workon message_serializers
-
Run Locust (use different configuration file depending on experiment)
locust -f locust_config/<LOCUST CONFIG>.py --host=<FLASK SERVER> --web-host=0.0.0.0
-
Open Locust in browser
0.0.0.0:8089
To run the experiments under a controlled environment, we launched 2 instances in Google Cloud - g1-small (1 vCPU, 1.7 GB memory) - one for the Flask server and another just for Locust.
A big thank you to @marcelolebre (my master Yoda) who introduced me to this technologies and pushed me to publish the blogpost.