Seastar
High performance C++ framework for concurrent servers
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 #ifndef SEASTAR_MODULE
25 #include <chrono>
26 #endif
27 #include <seastar/util/program-options.hh>
28 #include <seastar/util/memory_diagnostics.hh>
29 #include <seastar/util/modules.hh>
30 
31 namespace seastar {
32 
34 struct reactor_config {
35  bool auto_handle_sigint_sigterm = true;
36  unsigned max_networking_aio_io_control_blocks = 10000;
37 };
39 
40 class reactor_backend_selector;
41 class network_stack_factory;
42 
44 SEASTAR_MODULE_EXPORT
166 
168  std::string _argv0;
169  bool _auto_handle_sigint_sigterm = true;
171 
172 public:
176 };
177 
178 }
Definition: program-options.hh:290
Definition: program-options.hh:414
Seastar API namespace.
Definition: abort_on_ebadf.hh:26
Configuration for the reactor.
Definition: reactor_config.hh:45
program_options::value abort_on_seastar_bad_alloc
Abort when seastar allocator cannot allocate memory.
Definition: reactor_config.hh:123
program_options::value overprovisioned
Run in an overprovisioned environment (such as docker or a laptop).
Definition: reactor_config.hh:121
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:103
program_options::value< double > io_latency_goal_ms
Max time (ms) IO operations must take.
Definition: reactor_config.hh:71
program_options::value relaxed_dma
Allow using buffered I/O if DMA is not available (reduces performance).
Definition: reactor_config.hh:100
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:138
program_options::value poll_mode
Poll continuously (100% cpu use).
Definition: reactor_config.hh:55
program_options::value< double > task_quota_ms
Max time (ms) between polls.
Definition: reactor_config.hh:67
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:159
program_options::value no_handle_interrupt
Ignore SIGINT (for gdb).
Definition: reactor_config.hh:165
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:129
program_options::value< bool > blocked_reactor_report_format_oneline
Print a simplified backtrace on a single line.
Definition: reactor_config.hh:98
program_options::value< double > io_flow_ratio_threshold
Definition: reactor_config.hh:79
program_options::value heapprof
Enable seastar heap profiling.
Definition: reactor_config.hh:163
program_options::selection_value< reactor_backend_selector > reactor_backend
Internal reactor implementation.
Definition: reactor_config.hh:147
program_options::value< bool > poll_aio
Busy-poll for disk I/O.
Definition: reactor_config.hh:63
program_options::value< bool > kernel_page_cache
Use the kernel page cache.
Definition: reactor_config.hh:114
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:90
program_options::value< unsigned > blocked_reactor_reports_per_minute
Maximum number of backtraces reported by stall detector per minute.
Definition: reactor_config.hh:94
program_options::value< bool > aio_fsync
Use Linux aio for fsync() calls.
Definition: reactor_config.hh:151
program_options::value< bool > unsafe_bypass_fsync
Bypass fsync(), may result in data loss.
Definition: reactor_config.hh:108
program_options::value< unsigned > max_task_backlog
Maximum number of task backlog to allow.
Definition: reactor_config.hh:85
program_options::value< unsigned > idle_poll_time_us
Idle polling time in microseconds.
Definition: reactor_config.hh:59
program_options::selection_value< network_stack_factory > network_stack
Select network stack to use.
Definition: reactor_config.hh:53