The following image shows the response times for register and query data operations from 50,000 concurrent users:
To set up the Python environment for this project, follow these steps:
-
Create a Python virtual environment:
python -m venv .venv
-
Activate the virtual environment:
source .venv/bin/activate -
Install the required dependencies:
pip install -r requirements.txt
To compile the Protocol Buffers for the gRPC service, use the following command. Replace <external_coordinator_proto_dir> with the directory containing your .proto files and <external_coordinator_proto_file_path> with the path to your specific .proto file.
python -m grpc_tools.protoc \
--proto_path=<external_coordinator_proto_dir> \
--proto_path=./googleapis \
--python_out=. \
--grpc_python_out=. \
<external_coordinator_proto_file_path>To test the gRPC endpoint, run the provided Python client for the RPC interface:
python client_rpc.pyFor stress testing the RESTful API endpoint provided via the gRPC Gateway, use the following command:
python client_rest.pyTo visualize the response times generated from either rest or gRPC, use the following command:
python visualize.py <response_times_file>- Make sure to replace placeholders in the commands (like
<external_coordinator_proto_dir>) with actual values specific to your project. - Ensure that the
googleapisdirectory is correctly set up and contains the necessary files for gRPC-Gateway functionalities. - Always activate the virtual environment before running any Python scripts to ensure that dependencies are correctly managed.
