mattermost / docs

Mattermost documentation
https://docs.mattermost.com
BSD 3-Clause "New" or "Revised" License
207 stars 573 forks source link

Help Wanted: Align recommendations on file descriptor limits across all docs #4108

Open matterdoc opened 3 years ago

matterdoc commented 3 years ago

Context

File descriptors are an integer representing an abstract indicator used to access files or other input/output resources, such as pipes, network sockets, and devices.

Each process on a Unix-like operating system has a table of file descriptors, which it uses to keep track of the files it is interacting with.

The Mattermost server, being an application that heavily interacts with files, particularly for logging, temporary files, and user-uploaded content, requires a sizable number of file descriptors to operate efficiently.

Why is this important?

Limiting file descriptors helps with:

Keeping these limits appropriately set ensures that Mattermost can handle multiple users, concurrent connections, and throughput without running into resource constraints. Soft limits can be temporarily exceeded (up to the hard limit) if required.

How are they managed for Mattermost?

Mattermost System Admins can apply limits on the number of file descriptors allowed for the Mattermost server in 2 different ways:

  1. Setting those limits in the mattermost.service systemd unit file.
  2. Modifying the /etc/security/limits.conf file.

Docs Request

Update the Mattermost Product Documentation to help a system admin decide where to limit file descriptions (both mattermost.server and limits.conf), and detail the steps needed to limit file descriptors via with the following best practice recommendations for both soft and hard limits:

* soft nofile 65536
* hard nofile 65536
* soft nproc 8192
* hard nproc 8192

where:

mattermost.service via systemd

Use this approach when configuring limits specifically and only for the Mattermost service. This is ideal for scenarios where isolated and controlled changes are necessary.

Example:

[Service]
LimitNOFILE=65536

limits.conf

Use when you need to apply consistent limits across all processes run by a specific user or for legacy system compatibility. This is handy for scenarios requiring uniform configurations across a user’s entire session.

Note:

Changes in limits.conf typically require users to log out and back in to take effect, which might necessitate a system restart to fully apply and ensure consistency.

Example:

mattermost    soft    nofile    10240
mattermost    hard    nofile    40960

Internal Mattermost Docs Team follow-ups:

While we're here, we may need to do some cross-linking to make sure this information is easily discoverable.

For example, these guides should somehow bring me to this important consideration for large scale setups (i.e., file limit settings): https://docs.mattermost.com/deployment/cluster.html https://docs.mattermost.com/deployment/enterprise-deployment-guide.html

cwarnermm commented 2 years ago

@sadohert - Would you or a member of your team be open to creating a PR for this documentation request?

Shahbaz898414 commented 3 months ago

can you assign me this issue ?

cwarnermm commented 3 months ago

Are you interested in completing this ticket, @Shahbaz898414?