https://github.com/120dev/benchmark
https://github.com/120dev/benchmark
Last synced: 9 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/120dev/benchmark
- Owner: 120dev
- Created: 2023-11-06T14:27:50.000Z (about 2 years ago)
- Default Branch: main
- Last Pushed: 2023-11-06T15:33:20.000Z (about 2 years ago)
- Last Synced: 2025-02-15T20:34:38.003Z (11 months ago)
- Language: Shell
- Size: 6.84 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# PostgreSQL Benchmarking Script
## Overview
This repository contains a benchmarking script designed to test and measure the performance of a PostgreSQL database server. The script runs various database operations, including creating tables, inserting data, and executing complex SQL queries to simulate different loads on the server.
## Features
- **Environment Setup**: Configures the PostgreSQL environment using Docker, ensuring consistent test conditions.
- **Data Generation**: Inserts synthetic GPS data and points of interest to facilitate complex queries.
- **Performance Testing**: Executes a series of SQL commands to test database read and write operations, including:
- Insertions with `pgbench`.
- Complex SQL queries involving geospatial calculations.
- **Timing**: Measures the execution time of each operation using nanosecond precision for accurate benchmarking results.
## Prerequisites
Before running the script, ensure that you have the following installed:
- Docker
- Docker Compose
- PostgreSQL client tools
- `bc` command-line calculator (for generating GPS coordinate data)
## Usage
To execute the benchmarking script, follow these steps:
1. Clone the repository to your local machine.
2. Navigate to the cloned directory.
3. Ensure that the `.env` file is configured with the correct database parameters.
4. Run the script using the following command:
- `chmod +x go.sh`
- './go.sh'
The script will output the timing results to `benchmark_results.txt`, which can be reviewed to understand the performance characteristics of the PostgreSQL server.
## Customization
You can modify the script to include additional SQL queries or to adjust the complexity and volume of data being processed. This allows you to tailor the benchmark to your specific testing needs or to replicate the typical workload of your production environment.
## Contributing
Contributions to enhance the benchmarking script are welcome. Please feel free to submit pull requests or create issues for any bugs or improvements you identify.
## License
Specify your license here or indicate if the repository is open source.