forked from tarantool/tarantool
-
Notifications
You must be signed in to change notification settings - Fork 0
performance research
Alexey Khatskevich edited this page May 23, 2018
·
3 revisions
Tarantool (memtex) is an in-memory engine and It doesn't waste time to locks and synchronizations. Moreover, Tarantool can avoid writes to a disk.
Tarantools advantages:
- no locks
- no random disk writes
Tarantools disadvantages:
- single threaded
- any iteration over index is random reads from RAM (tuples are allocated in slabs)
There is an assumption that this architecture should help beat ordinary SQL databases.
- find performance bottlenecks
- compare the speed of Tarantool SQL with other DBs on different workloads
- beat other DBs
- enable LTO (plan described below) (it can disclose a real bottle-neck)
- btree bench (plan described below)
- sql - engine bench
- compare speed to
C
implementation of the same query- write tests
- huge select (~20% slowdoun)
- small select (~50% slowdoun)
- process results and put it here
- write tests
- investigate existing benchmarks
- check if bench is written correc for tarantool
- compare speed to
- io bench
- select over
net.box
- research fsync influence
- workload with lots of fibers
- workload with a single fiber
- nginx butching bench (possibly main perf improvement)
- user-space networking
- select over
- real-world bench
- steal a workload from production and analyze patterns and bottlenecks
- randomization influence
- absolute random (main consumer - cache misses)
- sequential (main consmer - msgpuck/btree call stack?)
- compare to hash index
- mixed
- find
main consumer changed
points
- find
- workload influence
- lots of small requests (part of
randomization influence
) -
select join
- huge join
- join + index
- w/o index
- with index
- lots of small requests (part of
- hint patch investigation (store data for comparition straight in btree)
- btree research
- block size, block traversal (current 512b + lineral traversal for hints)
- binary search is faster?
No
- other block size for lineral travversal is faster?
No
- binary search is faster?
- block size, block traversal (current 512b + lineral traversal for hints)
- btree research
- prefetch operation influence (async work with memory)
- write asyny-memory
hello_rowld.c
test
- write asyny-memory
Tarantool fails to start when compiled with LTO because linker ignores -Wl,--dynamic-list,${exports_file}
option
- create small prog to repeat exports problem
- see that LTO works
- see that on LTO enable exports disappear
- try to build with the gold linker (the same result)
- build with
-rdynamic
(exports preserved, binary changed)
- compile with clang (the same result)
- build with lto and
-rdynamic
(speed decreased?) - check
__attribute__((used))
(dynamic-list start working!) -> problem possibly in ld - Write minimal problem reproducer, which shows the export-lto-used problem
- Fix cmake to build with lto in case of new binutils
- Fix lto for mac
- Find out why gcc slows down?
-
O2
->O3
-
- sql
- lots of
memcpy
andmalloc
in SQL engine- ephemeral tables work inefficiently
- extra memcpy's on inserts to any table
- the absence of prepared statements (query recompiling on each request)
- the same core for query compilation and execution
- lots of
- architecture
- single threaded engine
- single-threaded scan
- sequential scan -> random reads (cache locality is not used)
- minor not covering b-tree indexes (random reads on any comparison)
- slow tuple compare
- huge stack of calls
- slow msgpuck
Architecture Specifications
- Server architecture
- Feature specifications
- What's in a good specification
- Functional indexes
- Space _index structure
- R tree index quick start and usage
- LuaJIT
- Vinyl
- SQL
- Testing
- Performance
How To ...?
- ... add new fuzzers
- ... build RPM or Deb package using packpack
- ... calculate memory size
- ... debug core dump of stripped tarantool
- ... debug core from different OS
- ... debug Lua state with GDB
- ... generate new bootstrap snapshot
- ... use Address Sanitizer
- ... collect a coredump
Lua modules
Useful links