MySQL 9.3.0
Source Code Documentation
my_system_api.h
Go to the documentation of this file.
1/* Copyright (c) 2025 Oracle and/or its affiliates.
2
3 This program is free software; you can redistribute it and/or modify
4 it under the terms of the GNU General Public License, version 2.0,
5 as published by the Free Software Foundation.
6
7 This program is designed to work with certain software (including
8 but not limited to OpenSSL) that is licensed under separate terms,
9 as designated in a particular file or component or in included license
10 documentation. The authors of MySQL hereby grant you an additional
11 permission to link the program and your derivative works with the
12 separately licensed software that they have either included with
13 the program or referenced in the documentation.
14
15 This program is distributed in the hope that it will be useful,
16 but WITHOUT ANY WARRANTY; without even the implied warranty of
17 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 GNU General Public License, version 2.0, for more details.
19
20 You should have received a copy of the GNU General Public License
21 along with this program; if not, write to the Free Software
22 Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
23
24#pragma once
25
26/**
27 Read the memory limit set by the container. Try cgroup v2, and then cgroup v1
28 @return memory limit set by cgroup v2 or cgroup v1; or 0
29 @note Return value of 0 implies either no limits are set or server is not
30 running in a container
31*/
32uint64_t my_cgroup_mem_limit();
33
34/**
35 Read the CPU limit set by the container. Try cgroup v2, and then cgroup v1
36 @return CPU limit set by cgroup v2 or cgroup v1; or 0
37 @note Return value of 0 implies either no limits are set or server is not
38 running in a container
39*/
40uint32_t my_cgroup_vcpu_limit();
41
42/**
43 Find number of VCPUs as seen by the current process based on the
44 affinity between each process and VCPU.
45*/
47
48/**
49 Get the number of VCPUS based on system configuration.
50*/
51uint32_t num_vcpus_using_config();
52
53/**
54 Get the number of VCPU.
55*/
56uint32_t my_system_num_vcpus();
uint64_t my_cgroup_mem_limit()
Read the memory limit set by the container.
Definition: my_system_api_cgroup.cc:142
uint32_t my_system_num_vcpus()
Get the number of VCPU.
Definition: my_system_api_common.cc:35
uint32_t num_vcpus_using_config()
Get the number of VCPUS based on system configuration.
Definition: my_system_api_apple.cc:38
uint32_t my_cgroup_vcpu_limit()
Read the CPU limit set by the container.
Definition: my_system_api_cgroup.cc:153
uint32_t num_vcpus_using_affinity()
Find number of VCPUs as seen by the current process based on the affinity between each process and VC...
Definition: my_system_api_apple.cc:36