> For the complete documentation index, see [llms.txt](https://developer.harness.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://developer.harness.io/self-managed-enterprise-edition/troubleshooting-and-resources/troubleshooting/database-crash.md).

# Database Crashes

When running databases on the Self-Managed Enterprise Edition, you may encounter errors such as **"Too many files open"**. These errors typically occur when the system file descriptor or process limits are too low.

To resolve this, follow the steps below to increase system limits (`ulimit`):

#### Steps to Update System Limits <a href="#steps-to-update-system-limits" id="steps-to-update-system-limits"></a>

1. Open the system configuration file:

   ```bash
   sudo nano /etc/systemd/system.conf
   ```
2. Modify or add the following parameters:

   ```bash
   DefaultLimitNOFILE=1048576
   DefaultLimitNPROC=1000000
   DefaultLimitSTACK=8388608
   ```

   <div data-gb-custom-block data-tag="hint" data-style="info" class="hint hint-info"><p>These values were initially unset (empty) and have been updated following MongoDB's best practice recommendations.</p></div>
3. Reload the system daemon to apply the configuration:

   ```bash
   sudo systemctl daemon-reexec
   ```
4. Reboot the machine:

   ```bash
   sudo reboot
   ```

### Troubleshooting <a href="#troubleshooting" id="troubleshooting"></a>

* **Changes not taking effect after reboot:**\
  Ensure you edited `/etc/systemd/system.conf` (not `/etc/systemd/user.conf`), and that there are no syntax errors.
* **Still seeing "Too many files open" errors:**\
  Confirm the limits by checking:

  ```bash
  ulimit -n
  ```
