Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve README: Add steps to fix slow start times for Elixir services #14

Open
wants to merge 8 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 29 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ The Dispatcher runs as an application in which the `Dispatcher` module is overri
1. [Host an EmberJS app](#Host-an-EmberJS-app)
2. [External API CORS headers](#External-API-CORS-headers)
3. [Provide 404 pages](#Provide-404-pages)
4. [Fix slow start times](#fix-slow-start-times)
7. [Architecture](#Architecture)
1. [forwarding connections with plug_mint_proxy](#Forwarding-Connections)
2. [Wiring with Plug](#Wiring-with-Plug)
Expand All @@ -34,7 +35,6 @@ The Dispatcher runs as an application in which the `Dispatcher` module is overri
### Configuration

The disptacher is configured using the dispatcher.ex file in a [mu-project](https://github.com/mu-semtech/mu-project).

The basic (default) configuration of the mu-dispatcher is an Elixir module named `Dispatcher` which uses the `Matcher` functionality.
An empty set of accept types is required (`define_accept_types []`).

Expand Down Expand Up @@ -465,6 +465,34 @@ defmodule Dispatcher do
end
end
```
### Fix slow start times

If you are experiencing slow start times (5-10 minutes) with Elixir services such as mu-dispatcher on recent kernels, you may need to limit file descriptors via `ulimit`:

1. **Edit Docker Daemon Configuration**:

Open the Docker daemon configuration file located at `/etc/docker/daemon.json` and add the following configuration:

```json
{
"default-ulimits": {
"nofile": {
"Name": "nofile",
"Soft": 104583,
"Hard": 104583
}
}
}
```

2. **Restart Docker**:

After updating the configuration, restart the Docker service to apply the changes:

```sh
sudo systemctl restart docker
```


## Architecture

Expand Down