2

I wanted to migrate to CentOS 7.5 from CentOS 6.9. during installation I saw an option kdump that i could enable or disable. I wonder what is kdump and disabling it has any bad effect on server? I want to install database on my server later I just want to make sure that kdump cause no problem.

BlackCrystal
  • 716
  • 14
  • 39

3 Answers3

2

kdump is a kernel crash dumping mechanism. In the event of a system crash, kdump produces a crash dump of the kernel that can be used for further analysis. Depending upon the severity of the failure, this crash dump may be the only information available for further analysis.

In the event of a system crash, kdump works by loading a second kernel into memory using the kexec system call. This second kernel captures the contents of the first kernel's memory. This information is saved as the crash dump.

To allow the second kernel to be loaded into memory, a part of the system memory has to be permanently reserved for it. This area of memory is inaccessible to the first kernel. The amount of memory reserved depends on the system architecture and the total amount of memory installed on the system. As an example, a system with the x86_64 architecture and 2 GiB of installed memory will require a minimum amount of 163968 KiB (160.25 MiB) to be reserved for kdump.

RHEL 7 (and CentOS 7, by extension) have the kdump mechanism installed and activated by default for (most) new installations. The Anaconda installer provides limited options for configuring kdump. Other installation options such as Kickstart may not have kdump enabled by default.

Further details on kdump (installation, configuration, usage) can be found at the RHEL 7 Documentation on Kernel Administration: Kernel Crash Dump Guide

Haxiel
  • 8,201
  • 1
  • 20
  • 30
2

kdump dumps the kernel memory in the event of a kernel crash. So

  1. If your kernel never crashes it is safe to disable kdump

  2. If you don't care about a kernel crash it is safe to disable kdump

  3. If you don't have a support contract and don't have the needed knowledge to debug a kernel crash yourself and are unwilling to pay someone on a one off basis to diagnose a kernel crash, it is safe to disable kdump.

Otherwise leave it enabled.

For most people (1) is true. For the rest either (2) or (3) is probably true. If you make a high value device with embedded linux then kdump can be extremely valuable.

icarus
  • 17,420
  • 1
  • 37
  • 54
  • I've run many production servers on various linux distros for around 19 years and have not once encountered a kernel crash on them. Not even on an experimental test server. I've only ever encountered kernel crashes when compiling my own kernel for a personal desktop system, when using experimental drivers or unusual settings, and even there, it's been rare. I've had servers run custom-compiled kernels with conservative settings and none of them ever crashed. – cazort Jul 30 '21 at 15:41
1

kdump is used exclusively to debug kernel crashes. Enabling it has one main downside, taking up a significant amount of memory. For example, on a system with 2GB RAM, it will use up just under 8% of the RAM. As RAM is often a limiting factor in the performance of servers, it's a hit to the "weakest link" for most users, so this can be a significant loss. Other than the RAM hit there are no downsides.

The question I would ask you is: are you ever going to need to debug a kernel crash?

CentOS, and its newer clones like Rocky Linux and AlmaLinux, as well as its commercial counterpart Red Hat Enterprise Linux, are usually chosen for stability in a production environment. In my 19+ years of running production servers, I have not once experienced a kernel crash on CentOS, or on any production server for that matter, even ones running "less stable" distros.

I have only ever experienced a kernel crash when compiling my own kernel for a desktop system using experimental drivers or settings, when using a "bleeding edge" Linux system like Gentoo or LFS. In these cases, I know what I'm getting into and I make sure kdump is enabled. Even there, crashes are rare. I have compiled many custom kernels for production servers and none of them have ever crashed.

The overwhelming majority of people running production servers will want to disable kdump. If you are using CentOS or any comparably stable distro and not compiling your own kernel, disable it. Some people who compile their own kernel, if they are confident in the settings they are using, may even want to disable it.

cazort
  • 111
  • 3