Chapter 17. Disabling graphics console output for latency sensitive workloads
The kernel starts passing messages to printk() as soon as it starts. The kernel sends messages to the log file and also displays on the graphics console even in the absence of a monitor attached to a headless server.
In some systems, the output sent to the graphics console might introduce stalls in the pipeline. This might cause potential delay in task execution while waiting for data transfers. For example, outputs sent to teletype0 (/dev/tty0), might cause potential stalls in some systems.
To prevent unexpected stalls, you can limit or disable the information that is sent to the graphic console by:
-
Removing the
tty0definition. - Changing the order of console definitions.
-
Turning off most
printk()functions and ensuring that you set theignore_loglevelkernel parameter tonot configured.
By disabling the graphics console output from logging on and by controlling the messages that print on the graphics console, you can improve latency on sensitive workloads.
17.1. Disabling graphics console logging to graphics adapter Copy linkLink copied to clipboard!
The teletype (tty) default kernel console enables your interaction with the system by passing input data to the system and displaying the output information about the graphics console.
Not configuring the graphics console, prevents it from logging on the graphics adapter. This makes tty0 unavailable to the system and helps disable printing messages on the graphics console.
Disabling graphics console output does not delete information. The information prints in the system log and you can access them using the journalctl or dmesg utilities.
Procedure
Remove the
console=tty0option from the kernel configuration:grubby --update-kernel=ALL --remove-args="console=tty0"
# grubby --update-kernel=ALL --remove-args="console=tty0"Copy to Clipboard Copied! Toggle word wrap Toggle overflow
17.2. Disabling messages from printing on graphics console Copy linkLink copied to clipboard!
You can control the amount of output messages that are sent to the graphics console by configuring the required log levels in the /proc/sys/kernel/printk file.
Procedure
View the current console log level:
cat /proc/sys/kernel/printk 7 4 1 7
$ cat /proc/sys/kernel/printk 7 4 1 7Copy to Clipboard Copied! Toggle word wrap Toggle overflow The command prints the current settings for system log levels. The numbers correspond to current, default, minimum, and boot-default values for the system logger.
Configure the desired log level in the
/proc/sys/kernel/printkfile.echo “1" > /proc/sys/kernel/printk
$ echo “1" > /proc/sys/kernel/printkCopy to Clipboard Copied! Toggle word wrap Toggle overflow The command changes the current console log level. For example, setting log level 1, will print only alert messages and prevent display of other messages on the graphics console.