> Markdown version of https://yucca.app/en/docs/troubleshooting/inotify_configuration/. Documentation index: [llms.txt](https://yucca.app/en/llms.txt), full text in one file: [llms-full.txt](https://yucca.app/en/llms-full.txt). Any page is available as Markdown: append `.md` to its URL without the trailing slash.

# Too many open files

> **Info.** If you need expert help to resolve this or any other issue, please review our **[technical support](https://yucca.app/en/docs/support.md)** terms and conditions.

## Description

With a large number of cameras, around 128, you may run into [Inotify](https://en.wikipedia.org/wiki/Inotify) limits — when adding a camera, you may then see the following message in the server log:

```sh
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0xe8 pc=0xdda663]

goroutine 1258 [running]:
gitlab.com/yuccastream/yucca/pkg/runner/latest.(*Runner).GetStats(...)
        /builds/yuccastream/yucca/pkg/runner/latest/runner.go:327
gitlab.com/yuccastream/yucca/pkg/server/executor/exec.(*Worker).GetStream(0xc002b74500)
        /builds/yuccastream/yucca/pkg/server/executor/exec/worker.go:188 +0xa3
gitlab.com/yuccastream/yucca/pkg/server/executor/exec.(*Executor).StatusStream(0xc0003f01c0, 0xc00074b6c0)
        /builds/yuccastream/yucca/pkg/server/executor/exec/executor.go:126 +0xb8
gitlab.com/yuccastream/yucca/pkg/server.(*Server).stateWatcher(0xc000c1e000)
        /builds/yuccastream/yucca/pkg/server/server.go:914 +0x233
created by gitlab.com/yuccastream/yucca/pkg/server.(*Server).Start in goroutine 1
        /builds/yuccastream/yucca/pkg/server/server.go:695 +0x4db

```

And in the log of one of the cameras:

```sh
Error: too many open files

```

By default, many Linux distributions have the following parameters set:

```sh
grep NOFILE /etc/systemd/system.conf
#DefaultLimitNOFILE=1024:524288

```

## Solution

To increase the limits, run:

```bash
sed -i 's/^#DefaultLimitNOFILE=.*/DefaultLimitNOFILE=10240:524288/' /etc/systemd/system.conf

```

Also increase this parameter for the yucca.service systemd unit, in the `/lib/systemd/system/yucca.service` file:

```sh
mkdir -p /etc/systemd/system/yucca.service.d/
cat > /etc/systemd/system/yucca.service.d/override.conf << 'EOF'
[Service]
LimitNOFILE=10240
EOF

sudo systemctl daemon-reload
sudo systemctl cat yucca  # проверить

```

Then apply the settings and restart the yucca.service process:

```sh
sudo systemctl restart yucca.service

```
