стоит арч, дефолтная конфиг mariadb, таблица 60K записей:
CREATE TABLE `tracks` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`album_fk` int(11) NOT NULL,
`genre_fk` int(11) NOT NULL,
`duration_s` int(11) NOT NULL,
`title` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
PRIMARY KEY (`id`),
UNIQUE KEY `uq_tracks` (`album_fk`,`title`),
KEY `fk_tracks_genres_idx` (`genre_fk`),
CONSTRAINT `fk_tracks_albums` FOREIGN KEY (`album_fk`) REFERENCES `albums` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
CONSTRAINT `fk_tracks_genres` FOREIGN KEY (`genre_fk`) REFERENCES `genres` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB AUTO_INCREMENT=66111 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
для бенчмарка использую запрос
select * from tracks where title = 'random_ololo'
такой строчкой запускаю
$ mysqlslap -u root -p"pass" --concurrency=`nproc` --number-of-queries=1000 --create-schema=mydb --query="select * from tracks where title = '`head /dev/urandom | tr -dc A-Za-z0-9 | head -c 13 ; echo ''`'" --delimiter=";" --verbose --iterations=2 --debug-info
Benchmark
Average number of seconds to run all queries: 3.320 seconds
Minimum number of seconds to run all queries: 3.273 seconds
Maximum number of seconds to run all queries: 3.368 seconds
Number of clients running queries: 8
Average number of queries per client: 125
User time 0.03, System time 0.02
Maximum resident set size 5852, Integral resident set size 0
Non-physical pagefaults 482, Physical pagefaults 0, Swaps 0
Blocks in 0 out 0, Messages in 0 out 0, Signals 0
Voluntary context switches 2107, Involuntary context switches 6
выходит примерно 333 запроса в секунду. если заменить рандом на константу - результат тот же. бд весит 4.5 мегабайта, стоит nmve и проц
$ lscpu | grep -E "Hz|Model name|CPU\(s\)"
CPU(s): 8
On-line CPU(s) list: 0-7
Model name: Intel(R) Core(TM) i5-8265U CPU @ 1.60GHz
CPU MHz: 753.866
CPU max MHz: 3900.0000
CPU min MHz: 400.0000
NUMA node0 CPU(s): 0-7
вопрос: как достичь тех мифических 50-60К запросов в секунду, о которых хвастают на stackoverflow?