Ensure that you have docker and docker-compose installed. To analyze MongoDB database, you will also need to install MongoDB Compass.
Start all the services via the command:
docker-compose upTo stop all services, press Ctrl+C.
If you want to keep running the services even after closing the terminal, use the -d or --detach flag:
docker-compose up -dThe services created are:
- web
- asynq-server
- asynqmon
- prometheus
- redis
- mongo
- nginx
To simulate a distributed system, where there are multiple copies of judge/server running on different systems, use the scale flag from docker-compose. For example, if you want the web server to be running on 2 machines and the judge to be running on 3 different machines, use the command
docker-compose up --scale web=2 --scale judge=3Once the application has started, a sample request to the server might looks like:
localhost:80/internal/simulate-concurrent-usersNote: nginx runs on port 80. You don't need to worry about which port the server runs on.
To access the application stats, visit Prometheus homepage at
localhost:9090To access the judge statistics, visit the Judge Monitor at
localhost:8080To access the databse, open up MongoDB Compass and use this connection string
mongodb://localhost:27017