https://github.com/matoking/ds-push-assignment
A simple RabbitMQ work queue for a Distributed Systems course assignment
https://github.com/matoking/ds-push-assignment
Last synced: 10 months ago
JSON representation
A simple RabbitMQ work queue for a Distributed Systems course assignment
- Host: GitHub
- URL: https://github.com/matoking/ds-push-assignment
- Owner: Matoking
- License: cc0-1.0
- Created: 2018-12-09T14:48:07.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2018-12-10T11:11:28.000Z (over 7 years ago)
- Last Synced: 2025-02-01T09:42:32.069Z (over 1 year ago)
- Language: Python
- Size: 6.84 KB
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# RabbitMQ Work Queue
A simple RabbitMQ based work queue using a push architecture.
# Description
The work queue uses the RabbitMQ message broker to transmit messages from the server to the client. Each message is ACK'd by the client before being removed from the message broker.
The following is done for each message:
1. Server broadcasts a message to `test_queue` queue
2. Client listens to the `test_queue` and receives a message.
3. Client acknowledges the message, removing the message from the queue
To benchmark the performance of the message broker, the server broadcasts a set amount of equal-sized messages which are processed by the client.
The `benchmark.py` script starts the sender (`server.py`) and receiver (`client.py`) scripts in parallel and prints the time taken once both
scripts have finished sending and receiving the messages.
# Installation
How to install (assuming Virtualenv for Python 3 is installed and RabbitMQ is running)
$ virtualenv -p python3 venv
$ source venv/bin/activate
$ pip install -r requirements.txt
Run a benchmark and print the time to send and receive the messages
$ # Send 5,000 messages, each with a size of 500 kB and measure the time it takes to send and receive the messages
$ python benchmark.py --payload-size=500000 --payload-count=5000
Run client and server individually
$ python server.py --payload-size=500000 --payload-count=5000
$ # In another terminal
$ python client.py --payload-count=5000