tarantool/benchmarks

Benchmarks for Tarantool PHP connectors.

Fund package maintenance!
rybakit

dev-master 2020-05-02 23:22 UTC

This package is auto-updated.

Last update: 2024-12-06 05:01:50 UTC


README

Telegram

This repository contains code to benchmark PHP connectors for Tarantool. Currently, there are two connectors available:

A more detailed explanation of the benchmarks represented in this repository can be found in this article.

Requirements

Usage

First, make sure you have the bench.lua instance running.

If you want to run it on Docker, execute:

docker run -d --network host --name=tarantool-bench \
   -v $PWD/bench.lua:/bench.lua tarantool/tarantool:2 tarantool /bench.lua

Then run

make

to see the usage text and a list of all available benchmarks. For example, to (re)run all benchmarks, execute

make clean bench-all

Alternatively, you may run benchmarks on Docker using Docker Compose:

docker-compose run --rm benchmarks make clean bench-all

You may change default benchmark settings by defining the following environment variables (in parentheses are the default values):

  • TNT_BENCH_TARANTOOL_URI (tcp://localhost:3301)
  • TNT_BENCH_TEMPLATE (default.php.tpl)
  • TNT_BENCH_ITERATIONS (5)
  • TNT_BENCH_REVOLUTIONS (10000)
  • TNT_BENCH_RETRY_THRESHOLD (3)

For example:

make clean bench-all TNT_BENCH_REVOLUTIONS=20000 TNT_BENCH_RETRY_THRESHOLD=5 

Results

The below results were made by running benchmarks on Apple MacBook Pro (2015) on the following environment:

  • Linux Fedora 30, kernel 5.3.8-200.fc30.x86_64
  • Tarantool 2.3.0-115-g5ba5ed37e running on Docker
  • Docker 19.03.3, build a872fc2f86
  • PHP 7.3.11 (cli) (built: Oct 22 2019 08:11:04) ( NTS )
  • PHP 7.3.11 (cli) (built: Oct 22 2019 08:11:04) ( ZTS )
  • tarantool/client 0.6.0
  • rybakit/msgpack 0.6.1
  • ext-tarantool 0.3.2 with the patch
  • ext-msgpack 2.0.3
  • ext-async 0.3.0-8c1da46
  • ext-swoole 4.4.12
  • ext-parallel 1.1.3

Sync connectors

chart

Sync client packers

chart

Sync client protocols

chart

Async coroutines

chart

Async connectors

chart

Async client protocols

chart

Swoole coroutines

chart

Swoole connectors

chart

Swoole client protocols

chart

Parallel threads

chart

Parallel connectors

chart

Parallel client protocols

chart

All extensions

chart

License

The library is released under the MIT License. See the bundled LICENSE file for details.