Closed jcheron closed 5 years ago
the absence of persistent connection, and prepared statements
Upcoming client release will have support for persistent connections, you can try it by installing the latest dev version: composer install tarantool/client:@dev
the Loading of 22 Tarantool-php/client files vs 1 for pdo
Doesn't matter if you use Opcache. Make sure you have it enabled and properly configured.
Apart from that I would recommend to use memtx
instead of vynil
(both engines are persistent, but memtx
is faster).
Also note, that Tarantool's SQL implementation is still under active development, there are a lot of optimizations planned. In that regard I would suggest running your benchmark using the binary protocol and compare results with the SQL ones (in my tests SQL ~2 times slower than the binary equivalent).
Another option to inmprove the performance is to make calls asynchrouniusly with ext-async
or ext-swoole
(according to my benchmars, you can gain 3x boost in performance).
I will publish by benchmark results soon in this repo.
Thank you for all these answers @rybakit
On this test and with my configuration:
memtx
or vinyl
).But I can't use it with Ubiquity
, since ORM is based on the relational model and SQL (the objective was to be able to switch from pdo/* to Tarantool in a transparent way, without the developer having to change his code).
Rq:
I don't quite agree on the effects of the number of files included. OPCache reduces the effect of multiple inclusions, but does not completely annihilate it (I did a special php-22
test where I included with pdo the 21 additional files required by Tarantool).
OPCache is well activated and configured on my test server.
So I did the benchmarks again in reading for Ubiquity, with memtx and persistent connection.
It's better:-) in particularly for throughput (+11%), more variable for execution time
I'll try with Swoole
to see how it goes.
Hi @rybakit Here are the results of the tests with Swoole: I always use the same tests (Techempower multiple writing and reading), however, the test server has changed, so do not compare these results with the previous ones, in absolute value.
All tests are performed with 20 consecutive queries.
Tarantool was already very fast, it is even faster
I made several tentatives with Tarantool, connection pool, small groups of asynchronous queries in a coroutine... These tests did not yield anything, I think that on this kind of tests (repeated single queries), you can't gain the 3X in performance..
So I came back to the simplest solution, Swoole + coroutine activation: which gives quite acceptable results with Tarantool, which is as fast as Swoole Coroutine Mysql. Don't forget that I only use SQL (and not the binary protocol).
Are the results of your benchmarks in this direction?
I was a little pessimistic about the reading performance: With a connection pool, and execution of queries in 5 groups of 4, the results are much better. [edit] With a properly adjusted connection pool, I now have fully satisfactory results, and we have more than 3X on the execution time (2.36 -> 0.73 ms), you were right 👍 [/edit]
@jcheron I have released a new version with minor optimizations and published benchmark results (up to 5x boost in those synthetic benchmarks).
Also, please note that unlike MySQL, Tarantool is single-threaded and to leverage more CPU cores it's recommended to run multiple Tarantool instances on the same server.
And the good news about the SQL performance is that the upcoming Tarantool version will have support for prepared statements.
That's good news, thank you ! I'm going to look at this closely.
Ubiquity-tarantool is almost operational, but there are certainly some adjustments to be made.
I performed some benchmarks using Techempower's multiple database queries test on my own servers, to appreciate the difference with pdo/mysql.
Ubiquity-Tarantool
is 9 times faster thanUbiquity-pdo
.I performed benchmarks without Ubiquity, to appreciate the difference in reading between Tarantool and pdo/mysql.
The results are as follows:
Reading of 20 rows on a table of 10,000 rows (php is pdo/mysql):
The difference is even greater than with Ubiquity, which is partly explained by:
Tarantool
Server configuration
Page source code:
pdo/mysql
Page source code:
Configuration for tests