PostgREST/postgrest-benchmark là dự án tập trung dữ liệu trên GitHub với 6 sao, viết chủ yếu bằng Nix. Reproducible benchmark for PostgREST
Tóm tắt dựng từ metadata GitHub của chính dự án — chưa có bài review TopGit. Trang sẽ tự động cập nhật khi bài review đầy đủ được xuất bản.
VÌ SAO CHƯA CÓ REVIEW
TopGit viết bài đầy đủ cho repo có nhiều sao nhất và được yêu cầu nhiều nhất. Trang này là snapshot trong thời gian chờ — xem README gốc ở tab READ ME.
Reproducible benchmark for PostgREST by using Nix and NixOps.
NixOps provisions AWS EC2 instances on a dedicated VPC and deploys the different components for load testing.
The default setup includes:
A m5a.8xlarge PostgreSQL server instance. Tuned according to PGTune recommendations.
A t3a.nano client instance with PostgREST + Nginx. The size of this EC2 instance, can be modified with environment variables.
PostgREST pool size is tuned according to the EC2 instance size.
A t3a.nano client instance with k6. The size of this EC2 instance, can be modified with environment variables.
All networking is setup so the client instances can reach the server instance.
Requirements
Nix.
AWS account with an ~/.aws/credentials file in place (can be created with aws-cli). The "default" profile is picked up by default but you can change it by doing:
export PGRSTBENCH_AWS_PROFILE="another_profile"
Quickstart
Run nix-shell. This will provide an environment where all the dependencies are available.
$ nix-shell
>
Deploy with:
$ postgrest-bench-deploy
pgrstBenchVpc.....> creating vpc under region us-east-2
..
pg................> activation finished successfully
pgrstbench> deployment finished successfully
# this command will take a couple minutes, it will deploy the client and server AWS machines VPC stuff
Run a k6 test on the client instance and get the output:
The postgresql server comes loaded with the chinook database.
To connect to the PostgREST instance:
$ postgrest-bench-ssh pgrst
# Check the installed services
$ systemctl list-units
# Do a request
$ curl localhost:80/artist
You can also get info (like the IPs) of the instances with:
$ postgrest-bench-info
K6
K6 runs on the client instance, but you can get the output of the load test on your machine:
## k6 will run with 20 VUs on the AWS client instance and load test the t3a.nano instance for 10 seconds with the local k6/GETSingle.js script
$ postgrest-bench-k6 20 10s k6/GETSingle.js
Multiple scripts can be supplied; each script runs sequentially for the specified duration:
There are different scripts on k6/ which test different PostgREST requests.
Pgbench
pgbench also runs on the client instance, you can get its output with:
$ postgrest-bench-pgbench pgbench/GETSingle.sql
The GETSingle.sql runs an equivalent SQL statement to what PostgREST generates for GETSingle.js. The motivation for this comparison is to see how much PostgREST performance differs from direct SQL connections.
Varying Scripts
There are scripts that help with varying the environment while load testing. You can use these to get a report once the command finishes running:
Run k6 with a different number of VUs:
$ postgrest-bench-k6-vary k6/GETSingle.js
Run k6 with varied VUs and with varied ec2 instances for the client and pgrst instances (this will involve reprovisioning/redeploying the client and pgrst instances, it will take a while):
You can use postgrest-bench-pgrst-vs to run a script using the current version vs another version or a binary.
# you can also add additional config to both
export PGRSTBENCH_PGRST_EXTRA_CONFIG='db-pipeline-mode = true'
postgrest-bench-pgrst-vs ./bin/pipeline-pgrst \
postgrest-bench-k6-vary-vus 1m k6/* \
> results/comparison.jsonl
Reports
You can generate reports from a JSONL file, for this use:
postgrest-bench-generate-report share/rts.jsonl
This generates SVG reports for each k6 script run, a summarized markdown comparing each configuration and a markdown with full details of the report.
Limitations
The instances tested for this benchmark are the t3a series and the m5a series.
ARM-based instances haven't been tested.
When the NixOS AMI goes out out of date, you can get these errors:
* client: list index out of range
* pg: list index out of range
* pgrst: list index out of range
To solve this run postgrest-bench-generate-ami
Other benchmarks
majkinetor/postgrest-test: PostgREST benchmark on Windows.
Trang TopGit này là một snapshot — tab "Readme" hiển thị nguyên văn README của repo (đã bỏ link, giữ ảnh). Repo GitHub ở github.com/PostgREST/postgrest-benchmark là nguồn chính thức.
PostgREST/postgrest-benchmark có bao nhiêu sao?
PostgREST/postgrest-benchmark có 6 sao GitHub — tải lại trang để xem số mới nhất, hoặc xem trực tiếp github.com/PostgREST/postgrest-benchmark. TopGit phản chiếu số sao của GitHub nhưng không cam kết đến từng phút.
PostgREST/postgrest-benchmark có những chủ đề gì?
GitHub topics của PostgREST/postgrest-benchmark: "benchmark", "nix", "nixops", "postgresql", "postgrest". TopGit xếp repo vào nhóm Data.
PostgREST/postgrest-benchmark có website riêng không?
TopGit chưa ghi nhận URL trang chủ cho PostgREST/postgrest-benchmark. Phần README ở tab phía trên thường có link demo, hoặc xem mô tả GitHub của repo.
PostgREST/postgrest-benchmark còn đang phát triển không?
Commit gần nhất trên PostgREST/postgrest-benchmark là 21 ngày trước (theo timestamp GitHub). Repo có 4 fork — một chỉ báo về mức độ quan tâm của cộng đồng.
PostgREST/postgrest-benchmark dùng license gì?
PostgREST/postgrest-benchmark phát hành theo license MIT. Nên mở file LICENSE trên GitHub để xác nhận — license metadata đôi khi lệch với thực tế dự án.
PostgREST/postgrest-benchmark viết bằng ngôn ngữ gì?
PostgREST/postgrest-benchmark chủ yếu viết bằng Nix. Trường "language" của GitHub dựa trên phần lớn byte ở nhánh mặc định.
Đọc đầy đủ README ở tab phía trên.
Chưa chắc postgrest-benchmark có hợp với bạn?
Để ChatGPT, Claude hoặc Perplexity tìm hiểu giúp — bấm bên dưới và xem AI nói gì về postgrest-benchmark.