Seastar
High performance C++ framework for concurrent servers
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Modules Pages
reactor_config.hh
1/*
2 * This file is open source software, licensed to you under the terms
3 * of the Apache License, Version 2.0 (the "License"). See the NOTICE file
4 * distributed with this work for additional information regarding copyright
5 * ownership. You may not use this file except in compliance with the License.
6 *
7 * You may obtain a copy of the License at
8 *
9 * http://www.apache.org/licenses/LICENSE-2.0
10 *
11 * Unless required by applicable law or agreed to in writing,
12 * software distributed under the License is distributed on an
13 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
14 * KIND, either express or implied. See the License for the
15 * specific language governing permissions and limitations
16 * under the License.
17 */
18/*
19 * Copyright (C) 2019 ScyllaDB
20 */
21
22#pragma once
23
24#include <seastar/util/program-options.hh>
25#include <seastar/util/memory_diagnostics.hh>
26#include <seastar/util/modules.hh>
28
29namespace seastar {
30
32struct reactor_config {
33 sched_clock::duration task_quota;
34 std::chrono::nanoseconds max_poll_time;
35 bool handle_sigint = true;
36 bool auto_handle_sigint_sigterm = true;
37 unsigned max_networking_aio_io_control_blocks = 10000;
38 bool force_io_getevents_syscall = false;
39 bool kernel_page_cache = false;
40 bool have_aio_fsync = false;
41 unsigned max_task_backlog = 1000;
42 bool strict_o_direct = true;
43 bool bypass_fsync = false;
44 bool no_poll_aio = false;
45};
47
48class reactor_backend_selector;
49class network_stack_factory;
50
52SEASTAR_MODULE_EXPORT
193
195 std::string _argv0;
196 bool _auto_handle_sigint_sigterm = true;
198
199public:
203};
204
205}
Definition: program-options.hh:293
Definition: program-options.hh:417
Seastar API namespace.
Definition: abort_on_ebadf.hh:26
Configuration for the reactor.
Definition: reactor_config.hh:53
program_options::value abort_on_seastar_bad_alloc
Abort when seastar allocator cannot allocate memory.
Definition: reactor_config.hh:136
program_options::value overprovisioned
Run in an overprovisioned environment (such as docker or a laptop).
Definition: reactor_config.hh:134
program_options::value< bool > linux_aio_nowait
Use the Linux NOWAIT AIO feature, which reduces reactor stalls due to aio (autodetected).
Definition: reactor_config.hh:116
program_options::value< double > io_latency_goal_ms
Max time (ms) IO operations must take.
Definition: reactor_config.hh:79
program_options::value relaxed_dma
Allow using buffered I/O if DMA is not available (reduces performance).
Definition: reactor_config.hh:113
program_options::value< memory::alloc_failure_kind > dump_memory_diagnostics_on_alloc_failure_kind
Dump diagnostics of the seastar allocator state on allocation failure.
Definition: reactor_config.hh:151
program_options::value poll_mode
Poll continuously (100% cpu use).
Definition: reactor_config.hh:63
program_options::value< double > task_quota_ms
Max time (ms) between polls.
Definition: reactor_config.hh:75
program_options::value< unsigned > max_networking_io_control_blocks
Maximum number of I/O control blocks (IOCBs) to allocate per shard.
Definition: reactor_config.hh:172
program_options::value< unsigned > io_completion_notify_ms
If an IO request is executed longer than that, this is printed to logs with extra debugging.
Definition: reactor_config.hh:92
program_options::value no_handle_interrupt
Ignore SIGINT (for gdb).
Definition: reactor_config.hh:192
program_options::value< bool > force_aio_syscalls
Force io_getevents(2) to issue a system call, instead of bypassing the kernel when possible.
Definition: reactor_config.hh:142
program_options::value< bool > blocked_reactor_report_format_oneline
Print a simplified backtrace on a single line.
Definition: reactor_config.hh:111
program_options::value< double > io_flow_ratio_threshold
Definition: reactor_config.hh:87
program_options::selection_value< reactor_backend_selector > reactor_backend
Internal reactor implementation.
Definition: reactor_config.hh:160
program_options::value< unsigned > heapprof
Enable seastar heap profiling.
Definition: reactor_config.hh:190
program_options::value< bool > poll_aio
Busy-poll for disk I/O.
Definition: reactor_config.hh:71
program_options::value< bool > kernel_page_cache
Use the kernel page cache.
Definition: reactor_config.hh:127
program_options::value< unsigned > blocked_reactor_notify_ms
Threshold in milliseconds over which the reactor is considered blocked if no progress is made.
Definition: reactor_config.hh:103
program_options::value< unsigned > blocked_reactor_reports_per_minute
Maximum number of backtraces reported by stall detector per minute.
Definition: reactor_config.hh:107
program_options::value< unsigned > reserve_io_control_blocks
Leave this many I/O control blocks (IOCBs) as reserve.
Definition: reactor_config.hh:182
program_options::value< bool > aio_fsync
Use Linux aio for fsync() calls.
Definition: reactor_config.hh:164
program_options::value< bool > unsafe_bypass_fsync
Bypass fsync(), may result in data loss.
Definition: reactor_config.hh:121
program_options::value< unsigned > max_task_backlog
Maximum number of task backlog to allow.
Definition: reactor_config.hh:98
program_options::value< unsigned > idle_poll_time_us
Idle polling time in microseconds.
Definition: reactor_config.hh:67
program_options::selection_value< network_stack_factory > network_stack
Select network stack to use.
Definition: reactor_config.hh:61