High performance C++ framework for concurrent servers
Public Member Functions | Friends | List of all members
seastar::scheduling_group Class Reference

Detailed Description

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
const sstringname () const
bool operator== (scheduling_group x) const
bool operator!= (scheduling_group x) const
bool is_main () const
void set_shares (float shares)


future< scheduling_groupcreate_scheduling_group (sstring name, float shares)
future destroy_scheduling_group (scheduling_group sg)
unsigned internal::scheduling_group_index (scheduling_group sg)
scheduling_group internal::scheduling_group_from_index (unsigned index)

Member Function Documentation

◆ set_shares()

void seastar::scheduling_group::set_shares ( float  shares)

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.

sharesnumber of shares allotted to the group. Use numbers in the 1-1000 range.

Friends And Related Function Documentation

◆ create_scheduling_group

future<scheduling_group> create_scheduling_group ( sstring  name,
float  shares 

Creates a scheduling group with a specified number of shares.

The operation is global and affects all shards. The returned scheduling group can then be used in any shard.

nameA name that identifiers the group; will be used as a label in the group's metrics
sharesnumber of shares of the CPU time allotted to the group; Use numbers in the 1-1000 range (but can go above).
a scheduling group that can be used on any shard

◆ destroy_scheduling_group

future destroy_scheduling_group ( scheduling_group  sg)

Destroys a scheduling group.

Destroys a scheduling_group previously created with create_scheduling_group(). The destroyed group must not be currently in use and must not be used later.

The operation is global and affects all shards.

sgThe scheduling group to be destroyed
a future that is ready when the scheduling group has been torn down

The documentation for this class was generated from the following file: