rocksdb/env
Gabriel Wicke 090c78a0d7 Support lowering CPU priority of background threads
Summary:
Background activities like compaction can negatively affect
latency of higher-priority tasks like request processing. To avoid this,
rocksdb already lowers the IO priority of background threads on Linux
systems. While this takes care of typical IO-bound systems, it does not
help much when CPU (temporarily) becomes the bottleneck. This is
especially likely when using more expensive compression settings.

This patch adds an API to allow for lowering the CPU priority of
background threads, modeled on the IO priority API. Benchmarks (see
below) show significant latency and throughput improvements when CPU
bound. As a result, workloads with some CPU usage bursts should benefit
from lower latencies at a given utilization, or should be able to push
utilization higher at a given request latency target.

A useful side effect is that compaction CPU usage is now easily visible
in common tools, allowing for an easier estimation of the contribution
of compaction vs. request processing threads.

As with IO priority, the implementation is limited to Linux, degrading
to a no-op on other systems.
Closes https://github.com/facebook/rocksdb/pull/3763

Differential Revision: D7740096

Pulled By: gwicke

fbshipit-source-id: e5d32373e8dc403a7b0c2227023f9ce4f22b413c
2018-04-24 08:41:51 -07:00
..
env_basic_test.cc Move some files under util/ to separate dirs 2017-04-05 19:09:16 -07:00
env_chroot.cc Change RocksDB License 2017-07-15 16:11:23 -07:00
env_chroot.h Change RocksDB License 2017-07-15 16:11:23 -07:00
env_encryption.cc Fix some typos in comments and docs. 2018-03-08 10:27:25 -08:00
env_hdfs.cc Disallow compactions if there isn't enough free space 2018-03-06 16:27:54 -08:00
env_posix.cc Support lowering CPU priority of background threads 2018-04-24 08:41:51 -07:00
env_test.cc Disable EnvPosixTest::FilePermission 2018-04-20 15:42:42 -07:00
env.cc include thread-pool priority in thread names 2018-04-18 17:27:56 -07:00
io_posix.cc fix memory leak in two_level_iterator 2018-04-15 17:26:26 -07:00
io_posix.h Comment out unused variables 2018-03-05 13:13:41 -08:00
mock_env_test.cc Move some files under util/ to separate dirs 2017-04-05 19:09:16 -07:00
mock_env.cc comment unused parameters to turn on -Wunused-parameter flag 2018-04-12 17:59:16 -07:00
mock_env.h Change RocksDB License 2017-07-15 16:11:23 -07:00
posix_logger.h Disallow compactions if there isn't enough free space 2018-03-06 16:27:54 -08:00