
https://db-benchmarks.com은 데이터베이스 및 검색 엔진 벤치 마크를 만드는 것을 목표로합니다.
⚖️ 공정하고 투명한 -이 데이터베이스 / 검색 엔진 이이 또는 그 성능을 제공하는 조건에서 명확해야합니다.
고품질 - 변동 계수에 대한 제어 오늘, 내일 또는 다음 주에 쿼리를 실행하는 경우 동일하게 남아있는 결과를 생성 할 수 있습니다.
? 쉽게 재현 가능 - 누구나 자신의 하드웨어에서 모든 테스트를 재현 할 수 있습니다.
이해하기 쉽습니다 - 차트는 매우 간단합니다
➕ 확장 가능 - 플러그 가능한 아키텍처는 더 많은 데이터베이스를 추가 할 수 있습니다.
그리고 100% 오픈 소스를 모두 보관하십시오!
이 저장소는 작업을 수행하는 테스트 프레임 워크를 제공합니다.
많은 데이터베이스 벤치 마크는 객관적이지 않습니다. 다른 사람들은 결과 정확성과 안정성을 보장하기에 충분하지 않으며, 어떤 경우에는 벤치 마크에 대한 전체 아이디어를 깨뜨립니다. 몇 가지 예 :
https://imply.io/blog/druid-nails-costefficiency-callenge-against-clickkickhouse-and-rockset/ :
우리는 실제로 동일한 하드웨어, M5.8xlarge에서 벤치 마크를하고 싶었지만 M5.8xlarge에 대한 유일한 사전 구운 구성은 실제로 M5D.8xlarge입니다 ... 대신 C5.9xlarge 인스턴스에서 실행됩니다.
나쁜 소식, 녀석 : 다른 하드웨어에서 벤치 마크를 실행할 때 최소한 무언가가 "106.76%"및 "103.13%"라고 말할 수는 없습니다. 동일한 베어 메탈 서버에서 테스트하더라도 5%미만의 변동 계수를 얻는 것은 매우 어렵습니다. 다른 서버의 3% 차이는 무시할 수 있습니다. 그 모든 것을 감안할 때, 어떻게 마지막 결론이 사실인지 확인할 수 있습니까?
https://tech.marksblogg.com/benchmarks.html
Mark는 다양한 데이터베이스 및 검색 엔진에서 택시 놀이기구 테스트를 잘 수행했습니다. 그러나 테스트는 다른 하드웨어에서 이루어 지므로 결과 테이블의 숫자는 실제로 비슷하지 않습니다. 테이블의 결과를 평가할 때는 항상 이것을 명심해야합니다.
https://clickhouse.com/benchmark/dbms/
각 쿼리를 3 번만 실행하면 각 쿼리가 각각에 대해 매우 높은 변동 계수를 얻을 수 있습니다. 즉, 1 분 후 테스트를 실행하면 20%의 변화가 발생할 수 있습니다. 그리고 자신의 하드웨어에 대한 테스트를 어떻게 재현합니까? 불행히도, 나는 그것을 어떻게 할 수 있는지 찾을 수 없습니다.
우리의 믿음은 공정한 데이터베이스 벤치 마크가 몇 가지 주요 원칙을 따라야한다는 것입니다.
✅ 정확히 동일한 하드웨어에서 다른 데이터베이스를 테스트하십시오
그렇지 않으면 차이가 작은 경우 오류 마진을 인정해야합니다.
✅ 각 테스트 전에 풀 OS 캐시를 사용하여 테스트
그렇지 않으면 차가운 쿼리를 테스트 할 수 없습니다.
✅ 테스트중인 데이터베이스에는 모든 내부 캐시가 비활성화되어야합니다.
그렇지 않으면 캐시 성능을 측정합니다.
cold 콜드 달리기를 측정하는 경우 가장 좋습니다. 콜드 쿼리가 자주 발생할 수있는 분석 쿼리에 특히 중요합니다.
그렇지 않으면 데이터베이스가 I/O를 처리하는 방법을 완전히 숨 깁니다.
testing 테스트 중에는 다른 것이 실행되지 않아야합니다
그렇지 않으면 테스트 결과가 매우 불안정 할 수 있습니다.
✅ 각 쿼리 전에 데이터베이스를 다시 시작해야합니다.
그렇지 않으면, 이전 쿼리는 내부 캐시를 지우더라도 여전히 현재 쿼리의 응답 시간에 영향을 줄 수 있습니다.
∎ 데이터베이스가 시작된 후 완전히 예열 될 때까지 기다려야합니다.
그렇지 않으면, 테스트 결과를 심각하게 망칠 수있는 I/O에 대한 데이터베이스의 워밍업 프로세스와 경쟁 할 수 있습니다.
west 변동 계수를 제공하는 경우 가장 좋습니다. 모든 사람이 결과가 얼마나 안정적인지 이해하고 충분히 낮은지 확인하십시오.
변동 계수는 테스트 결과가 얼마나 안정적인지를 보여주는 매우 좋은 메트릭입니다. N%보다 높으면 한 데이터베이스가 다른 데이터베이스보다 N% 빠르다고 말할 수 없습니다.
✅ 고정 된 CPU 주파수를 테스트하는 경우 최상의
그렇지 않으면 "주문형"CPU 주지사 (일반적으로 기본값)를 사용하는 경우 500ms 응답 시간을 1000+ MS로 쉽게 전환 할 수 있습니다.
HDD 대신 SSD/NVME에서 테스트하는 경우 가장 좋습니다.
그렇지 않으면, 파일의 위치에 따라 HDD의 위치에 따라 최대 2 배 낮은 I/O 성능 (테스트)을 얻을 수있어 최소한의 콜드 쿼리가 잘못 될 수 있습니다.
https://db-benchmarks.com의 백엔드에서 사용되는 테스트 프레임 워크는 완전히 오픈 소스 (AGPLV3 라이센스)이며 https://github.com/db-benchmarks/db-benchmarks에서 찾을 수 있습니다. 다음은 다음과 같습니다.
--limited )--test 테스트 결과를 파일에 저장합니다--save 파일에서 원격 데이터베이스로 테스트 결과를 저장합니다 (테스트 된 것 중 어느 것도 없음)select count(*) 하고 select * limit 1 데이터 컬렉션이 다른 데이터베이스에서 비슷한 지 확인하십시오.cpuset 및 mem 사용).테스트 프레임 워크를 배포하기 전에 다음 사항이 있는지 확인하십시오.
PHP 8 및 :curl 모듈mysqli 모듈dockerdocker-composesensorsdstatcgroups v2설치하려면 :
git clone [email protected]:db-benchmarks/db-benchmarks.git
cd db-benchmarks.env.example .env 로 복사하십시오.env 에서 mem 및 cpuset 업데이트합니다. 테스트 프레임 워크는 보조 작업 (데이터로드, 데이터베이스에 대한 정보 얻기)에 사용할 수 있습니다.ES_JAVA_OPTS 조정하십시오. 일반적으로 Docker Machine에 할당 된 메모리의 크기입니다 먼저 시험을 준비해야합니다.
특정 테스트 디렉토리 (모든 테스트는 디렉토리 ./tests 에 있어야 함)로 이동하십시오. 예를 들어 "HN_SMALL":
cd tests/hn_smallInit 스크립트 실행 :
./init이것은 :
그런 다음 실행 ../../test (프로젝트 루트 폴더에 있습니다) 옵션을 확인하십시오.
To run a particular test with specified engines, memory constraints and number of attempts and save the results locally:
/perf/test_engines/test
--test=test_name
--engines={engine1:type,...,engineN}
--memory=1024,2048,...,1048576 - memory constraints to test with, MB
[--times = N] - max number of times to test each query, 100 by default
[--dir = path] - if path is omitted - save to directory ' results ' in the same dir where this file is located
[--probe_timeout = N] - how long to wait for an initial connection, 30 seconds by default
[--start_timeout = N] - how long to wait for a db/engine to start, 120 seconds by default
[--warmup_timeout = N] - how long to wait for a db/engine to warmup after start, 300 seconds by default
[--query_timeout = N] - max time a query can run, 900 seconds by default
[--info_timeout = N] - how long to wait for getting info from a db/engine
[--limited] - emulate one physical CPU core
[--queries = /path/to/queries] - queries to test, ./tests/ < test name > /test_queries by default
To save to db all results it finds by path
/perf/test_engines/test
--save=path/to/file/or/dir, all files in the dir recursively will be saved
--host=HOSTNAME
--port=PORT
--username=USERNAME
--password=PASSWORD
--rm - remove after successful saving to database
--skip_calm - avoid waiting until discs become calm
----------------------
Environment variables:
All the options can be specified as environment variables, but you can ' t use the same option as an environment variables and as a command line argument at the same time.테스트를 실행하십시오.
../../test --test=hn_small --engines=elasticsearch,clickhouse --memory=16384 로컬 모드 (개발)에서 테스트를 실행하고 테스트 부정확성에 신경 쓰지 않으면 매개 변수 --skip_inaccuracy 설정하여 Discs Calm 및 CPU 검사를 피할 수 있습니다.
../../test --test=hn_small --engines=elasticsearch,clickhouse --memory=16384 --skip_inaccuracy 이제 ./results/ (저장소의 루트에)에 테스트 결과가 있습니다.
# ls results/
220401_054753이제 추가 시각화를 위해 결과를 데이터베이스에 업로드 할 수 있습니다. https://db-benchmarks.com/에서 사용되는 시각화 도구는 오픈 소스이며 https://github.com/db-benchmarks/ui에서 찾을 수 있습니다.
결과를 저장하는 방법은 다음과 같습니다.
username=login password=pass host=db.db-benchmarks.com port=443 save=./results ./test또는
./test --username=login --password=pass --host=db.db-benchmarks.com --port=443 --save=./results
우리는 귀하의 테스트 결과를보고 싶어합니다. https://db-benchmarks.com에 추가해야한다고 생각되면이 저장소에 결과를 풀어주십시오.
다음 사항을 염두에 두십시오.
./results 에 있어야합니다.그런 다음 우리는 다음과 같습니다.
.
|-core <- Core directory, contains base files required for tests.
| |-engine.php <- Abstract class Engine. Manages test execution, result saving, and parsing of test attributes.
| |-helpers.php <- Helper file with logging functions, attribute parsing, exit functions, etc.
|-misc <- Miscellaneous directory, intended for storing files useful during the initialization step.
| |-func.sh <- Meilisearch initialization helper script.
|-plugins <- Plugins directory: if you want to extend the framework by adding another database or search engine for testing, place it here.
| |-elasticsearch.php <- Elasticsearch plugin.
| |-manticoresearch.php <- Manticore Search plugin.
| |-clickhouse.php <- ClickHouse plugin.
| |-mysql.php <- MySQL plugin.
| |-meilisearch.php <- Meilisearch plugin.
| |-mysql_percona.php <- MySQL (Percona) plugin.
| |-postgres.php <- Postgres plugin.
| |-typesense.php <- Typesense plugin.
|-results <- Test results directory. The results shown on https://db-benchmarks.com/ are found here. You can also use `./test --save` to visualize them locally.
|-tests <- Directory containing test suites.
| |-hn <- Hackernews test suite.
| | |-clickhouse <- Directory for "Hackernews test -> ClickHouse".
| | | |-inflate_hook <- Engine initialization script. Handles data ingestion into the database.
| | | |-post_hook <- Engine verification script. Ensures the correct number of documents have been ingested and verifies data consistency.
| | | |-pre_hook <- Engine pre-check script. Determines if tables need to be rebuilt, starts the engine, and ensures availability.
| | |-data <- Prepared data collection for the tests.
| | |-elasticsearch <- Directory for "Hackernews test -> Elasticsearch".
| | | |-logstash_tuned <- Logstash configuration directory for the "tuned" type.
| | | | |-logstash.conf
| | | | |-template.json
| | | |-elasticsearch_tuned.yml
| | | |-inflate_hook <- Engine initialization script for data ingestion.
| | | |-post_hook <- Verifies document count and data consistency.
| | | |-pre_hook <- Pre-check script for table rebuilding and engine initialization.
| | |-manticoresearch <- Directory for testing Manticore Search in the Hackernews test suite.
| | | |-generate_manticore_config.php <- Script for dynamically generating Manticore Search configuration.
| | | |-inflate_hook <- Data ingestion script.
| | | |-post_hook <- Verifies document count and consistency.
| | | |-pre_hook <- Pre-check for table rebuilds and engine availability.
| | |-meilisearch <- Directory for "Hackernews test -> Meilisearch".
| | | |-inflate_hook <- Data ingestion script.
| | | |-post_hook <- Ensures correct document count and data consistency.
| | | |-pre_hook <- Pre-check for table rebuilds and engine start.
| | |-mysql <- Directory for "Hackernews test -> MySQL".
| | | |-inflate_hook <- Data ingestion script.
| | | |-post_hook <- Ensures document count and consistency.
| | | |-pre_hook <- Pre-check for table rebuilds and engine start.
| | |-postgres <- Directory for "Hackernews test -> Postgres".
| | | |-inflate_hook <- Data ingestion script.
| | | |-post_hook <- Verifies document count and data consistency.
| | | |-pre_hook <- Pre-check for table rebuilds and engine availability.
| | |-prepare_csv <- Prepares the data collection, handled in `./tests/hn/init`.
| | |-description <- Test description, included in test results and used during result visualization.
| | |-init <- Main initialization script for the test.
| | |-test_info_queries <- Contains queries to retrieve information about the data collection.
| | |-test_queries <- Contains all test queries for the current test.
| |-taxi <- Taxi rides test suite, with a similar structure.
| |-hn_small <- Test for a smaller, non-multiplied Hackernews dataset, similar structure.
| |-logs10m <- Test for Nginx logs, similar structure.
|-.env.example <- Example environment file. Update the "mem" and "cpuset" values as needed.
|-LICENSE <- License file.
|-NOTICE <- Notice file.
|-README.md <- You're reading this file.
|-docker-compose.yml <- Docker Compose configuration for starting and stopping databases and search engines.
|-important_tests.sh
|-init <- Initialization script. Handles data ingestion and tracks the time taken.
|-logo.svg <- Logo file.
|-test <- The executable file to run and save test results.
test=logs10m cpuset= " 0,1 " mem=32768 suffix=_tuned docker-compose up elasticsearch할 것이다:
suffix=_tuned : 맵 ./tests/logs10m/es/data/idx_tuned 데이터 디렉토리로mem=32768 RAM을 32GB로 제한합니다. 지정되지 않으면 기본값은 file .env 에서 사용됩니다.cpuset="0,1" : Elasticsearch의 컨테이너는 CPU 코어 0 및 1에서만 실행됩니다 (첫 번째 물리적 CPU 일 수 있음) 중지하려면 CTRL-C 입니다.
프로젝트에 참여하고 싶습니까? 기여하는 방법은 다음과 같습니다.
이것들은 모두 당신의 기여를 기다리고 있습니다!