Seastar
High performance C++ framework for concurrent servers
|
Identifies function calls that are accounted as a group.
A scheduling_group
is a tag that can be used to mark a function call. Executions of such tagged calls are accounted as a group.
#include <seastar/core/scheduling.hh>
Public Member Functions | |
constexpr | scheduling_group () noexcept |
Creates a scheduling_group object denoting the default group. | |
bool | active () const noexcept |
const sstring & | name () const noexcept |
const sstring & | short_name () const noexcept |
bool | operator== (scheduling_group x) const noexcept |
bool | operator!= (scheduling_group x) const noexcept |
bool | is_main () const noexcept |
bool | is_at_exit () const noexcept |
template<typename T > | |
T & | get_specific (scheduling_group_key key) noexcept |
void | set_shares (float shares) noexcept |
float | get_shares () const noexcept |
future | update_io_bandwidth (uint64_t bandwidth) const |
Updates the current IO bandwidth for a given scheduling group. More... | |
|
noexcept |
Returns the number of shares the group has
Similarly to the set_shares, the returned value is only relevant to the calling shard
|
inlinenoexcept |
Returnes a reference to this scheduling group specific value
T | - the type of the scheduling specific type (cannot be deduced) |
key | - the key of the value to retrieve. |
|
noexcept |
Adjusts the number of shares allotted to the group.
Dynamically adjust the number of shares allotted to the group, increasing or decreasing the amount of CPU bandwidth it gets. The adjustment is local to the shard.
This can be used to reduce a background job's interference with a foreground load: the shares can be started at a low value, increased when the background job's backlog increases, and reduced again when the backlog decreases.
shares | number of shares allotted to the group. Use numbers in the 1-1000 range. |
future seastar::scheduling_group::update_io_bandwidth | ( | uint64_t | bandwidth | ) | const |
Updates the current IO bandwidth for a given scheduling group.
The bandwidth applied is NOT shard-local, instead it is applied so that all shards cannot consume more bytes-per-second altogether
bandwidth | the new bandwidth value in bytes/second |