Score:0

Ubuntu Server 20.04 freezes every couple of days

br flag

Short Intro

Since a couple of days, my physical server keeps freezing every 2 or 3 days. I have already replaced all hardware, including the drives, and did a fresh installation of Ubuntu.

Details & Findings

No luck so far when searching the log files:

  • Every syslog or kernel log file shows ^@^@^@^@^@^@^@^@^@^@^@^@ at the time of the freeze. Before that, there is no suspicious behavior for at least 15 mins before the time of the freeze.
  • journal logs from last reboot can be found here. Since I run UFW, it's a bit messy. The freeze happened at approx. 09:45h.
  • I have the server in my monitoring. There is no increase of CPU, RAM, DiskIO, Disk space nor traffic on the network interface shortly before the freezes happen. CPU, RAM, and disk space are also not above a limit.
  • Once the server freezes, I can do nothing at the console anymore. I need to reboot the server (hard reset) to get it back running for a couple of days.
What I run on the server:
  • nginx
  • php-fpm
  • laravel 8
  • ufw
  • fail2ban
  • mysql 8
Actions I have already taken, found in similar posts:
  • Adjust min free RAM:
    • sysctl -w vm.min_free_kbytes=235929
    • sysctl -w vm.swappiness=5

Since most logs show some random signs, I appreciate any help what to do next. I don't know what else I could check. Thanks for any tips & help provided!

Jorge Yanes Diez avatar
us flag
You talk about "physical server" and "hoster" which leads me to believe you are running a VM on that physical server? Are you sure it's the physical machine that hangs and not the VM? Sounds to me like some sort of automated VM backup operation is interfering with your system.
k304 avatar
br flag
@JorgeYanesDiez It is a physical and dedicated server I rented at OVH. Sorry for the confusion.
Score:1
id flag
  1. Try different kernel versions (kernels of other Ubuntu versions, e.g. 18.04, 22.04, a mainline kernel build) and see whether the problem persists. If your server doesn't crash with other kernel versions, then you're dealing with a kernel bug affecting 20.04.
  2. It seems even if the kernel perceives the failure, it can't write the problem to syslog. Check whether you see a kernel panic on the console, but if the screen is switched off, you can't switch it back on with a crashed kernel. So you should disable the screen going off due to inactivity. Also you can try using a crashkernel (kdump) to get more information about the crash; or you can probably redirect console output to serial port and log the output with an external device, but I never actually tried that.
  3. You can also test different Ubuntu releases altogether, or perhaps different Linux distributions, but usually that's not necessary (crashes are usually caused by the kernel and its drivers, the distro built around it rarely matters). You can even try a different operating system, like FreeBSD or Windows, to see whether the computer keeps freezing – if the freeze also happens with other OSes, you certainly have a hardware problem.
  4. Run memtest to detect possible faulty RAM modules. Memtest needs full control over the computer (you have to boot it instead your operating system), so your server can't operate while the test is running.
  5. Unfortunately, hardware failures can be pretty insidious when it's not apparent what is the problem. I don't know what have you replaced, but you can even have a faulty motherboard, CPU or PSU. Once my computer kept randomly switching off. At first I had no idea what is the cause but then it turned out my power cord has contact problems – replacing it ceased the issue.
k304 avatar
br flag
Thanks for your reply. I have already replaced all hardware (in fact its a hosted server at some french company, so they told me they have fully replaced all hardware). Including CPU, Mainboard, etc. So probably not a hardware issue tho, they have found faulty RAM & Mainboard in the old server. I've already tried different kernel versions. And even updated the kernel lately as there has been a newer version. I'll have a look at `kdump` and see what it will report to me.
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.