I'm having a PC freeze issue that I can't seem to figure out. I have three identical PCs. They are each custom builds with i7 and 64GB of RAM. The OS drives are 512GB nvme drives. They each run CentOS v7.8.2003 with kernel v3.10. I'm running some custom software that stores huge chunks of data, processes it, and then re-stores it.
It may be relevant to show the custom configurations done to the OS.
Custom fstab:
UUID=xxxxxx / ext4 noatime,nodiratime,discard 1 1
UUID=xxxxxx swap swap defaults 0 0
tmpfs /dev/shm tmpfs defaults,noatime,mode=1777 0 0
tmpfs /tmp tmpfs defaults,noatime,mode=1777 0 0
devpts /dev/pts devpts gid=5,mode=620 0 0
sysfs /sys sysfs defaults 0 0
proc /proc proc defaults 0 0
LABEL=drive1 /data/drive1 auto noatime,nodiratime,discard,nofail 0 0
LABEL=drive2 /data/drive2 auto noatime,nodiratime,discard,nofail 0 0
LABEL=drive3 /data/drive3 auto noatime,nodiratime,discard,nofail 0 0
LABEL=drive4 /data/drive4 auto noatime,nodiratime,discard,nofail 0 0
LABEL=drive5 /data/drive5 auto noatime,nodiratime,discard,nofail 0 0
LABEL=drive6 /data/drive6 auto noatime,nodiratime,discard,nofail 0 0
Custom sysctl.conf:
vm.swappiness=1
vm.vfs_cache_pressure=50
I don't want to go into too much detail on the software but what is relevant is that it receives data at an extremely fast rate. The data is stored to five SATA SSDs connected directly to the motherboard. (writing to 5 in parallel was the only way for the write speeds to keep up with the inflow of data) The data is stored in large chunks (files) that are later processed and then stored to a sixth SATA SSD. I don't know the details of how some of the software works but I do know that some of the processes use large chunks of shared memory.
The Problem: Sometimes the PC will freeze when a new chunk of data comes in. This freeze is unrecoverable and requires a hard reboot. When it occurs is random but it is always at the start of a new data collect. Changing the software parameters and enabling/disabling certain processes can affect the frequency of when the freeze occurs. This doesn't allow me to narrow it down though as it doesn't seem to be tied to a particular process. Its just that some configurations make it more likely to occur. I did find a particular configuration that allows me to consistently recreate the issue so at least that helps for testing.
I have worked with the devs that wrote the software but we are unable to find any issues that could cause a PC to freeze. I have also tested the software for memory leaks but cannot find any.
To my mind all of this points to a memory issue. However, I can't actually find a memory issue. I have used top and free on the command line and System Monitor in Gnome but there are no indications of any memory issues. The CPU load isn't too high and the PC isn't even using half of the 64GB of RAM. If this is a memory issue then I'm either missing something or it is happening so fast that monitoring and logging can't catch it.
Now to the heart of the matter: In an act of desperation, one of my partners did this:
vm.overcommit_memory=2
vm.overcommit_ratio=80
This "seemed" to fix the issue. I can no longer recreate the freeze. If I monitor the memory while going through the steps to recreate the issue, I don't see anything unusual. None of the processes crashed and the software just did what it was designed to do. This makes me feel like the cause of the freeze isn't the software but the way the OS is configured relative to the atypical way the PC is being used.
I have read the documentation but it is unhelpful with regards to how changing overcommit_memory might affect other parts of the system or with providing any examples of when you would want to change it. I've looked for more information on the forums but I mostly find "don't touch it unless you know what you're doing". I also worry about OOM killing important processes if too much memory is requested.
Can someone please tell me when you would want to change the overcommit_memory settings. Does my situation count as one where you would need to change them? If so, what should I look out for in regards to how it could affect other aspects of the system?