MySQL 9.6.0
Source Code Documentation
my_system_api.h File Reference

Go to the source code of this file.

Functions

bool is_running_in_cgroup ()
 Determines if the current process is running in a container. More...
 
bool does_cgroup_limit_resources ()
 Determines if cgroup restricts resources. More...
 
uint64_t my_cgroup_mem_limit ()
 Read the memory limit set by the container. More...
 
uint32_t my_cgroup_vcpu_limit ()
 Read the CPU limit set by the container. More...
 
uint32_t num_vcpus_using_affinity ()
 Find number of VCPUs as seen by the current process based on the affinity between each process and VCPU. More...
 
uint32_t num_vcpus_using_config ()
 Get the number of VCPUS based on system configuration. More...
 
uint32_t my_system_num_vcpus ()
 Get the number of VCPU. More...
 

Function Documentation

◆ does_cgroup_limit_resources()

bool does_cgroup_limit_resources ( )

Determines if cgroup restricts resources.

Returns
true if cgroup restricts resources like CPU or memory

◆ is_running_in_cgroup()

bool is_running_in_cgroup ( )

Determines if the current process is running in a container.

Returns
true if running in either cgroup v1 or cgroup v2, false otherwise

◆ my_cgroup_mem_limit()

uint64_t my_cgroup_mem_limit ( )

Read the memory limit set by the container.

Try cgroup v2, and then cgroup v1

Returns
memory limit set by cgroup v2 or cgroup v1; or 0
Note
Return value of 0 implies either no limits are set or server is not running in a container

◆ my_cgroup_vcpu_limit()

uint32_t my_cgroup_vcpu_limit ( )

Read the CPU limit set by the container.

Try cgroup v2, and then cgroup v1

Returns
CPU limit set by cgroup v2 or cgroup v1; or 0
Note
Return value of 0 implies either no limits are set or server is not running in a container

◆ my_system_num_vcpus()

uint32_t my_system_num_vcpus ( )

Get the number of VCPU.

◆ num_vcpus_using_affinity()

uint32_t num_vcpus_using_affinity ( )

Find number of VCPUs as seen by the current process based on the affinity between each process and VCPU.

◆ num_vcpus_using_config()

uint32_t num_vcpus_using_config ( )

Get the number of VCPUS based on system configuration.