Rocket.chat: How to increase file descriptors in Caddy service within Snap?

Created on 16 May 2017  路  9Comments  路  Source: RocketChat/Rocket.Chat

Rocket.Chat Version: 0.55.1
Running Instances: 1
DB Replicaset OpLog: Enabled
Node Version: v4.8.0

On startup of caddy service I get:

WARNING: File descriptor limit 1024 is too low for production servers. At least 8192 is recommended. Fix with "ulimit -n 8192

I can modify /etc/systemd/system/snap.rocketchat-server.rocketchat-caddy.service with LimitNOFILE=8192 but I'm assuming that's not recommended.

Can someone please advise what the proper way to increase file descriptors is within the snap?

Planned snaps

Most helpful comment

You should be able to do this:

# mkdir /etc/systemd/system/snap.rocketchat-server.rocketchat-caddy.service.d
# echo -e "[Service]\nLimitNOFILE=8192 " > /etc/systemd/system/snap.rocketchat-server.rocketchat-caddy.service.d/limits.conf
# snap restart <whatever the snap service is called>

All 9 comments

Currently not possible to make persist between updates. You found the solution I would have suggested for short term.

However I don't think this warning is critical with just rocket.chat behind caddy.

I've added it to the short term roadmap to get this addressed though.

Thank you!

You should be able to do this:

# mkdir /etc/systemd/system/snap.rocketchat-server.rocketchat-caddy.service.d
# echo -e "[Service]\nLimitNOFILE=8192 " > /etc/systemd/system/snap.rocketchat-server.rocketchat-caddy.service.d/limits.conf
# snap restart <whatever the snap service is called>

Your solution work fine! tnx

Beware that doing this might go away with snap updates. As I know snap does generate the unit file. Maybe it doesn鈥檛 touch the folder but beware just in case

Beware that doing this might go away with snap updates. As I know snap does generate the unit file. Maybe it doesn鈥檛 touch the folder but beware just in case

This seems to be the relevant code (also see around line 394). It does not seem to touch the directories...

馃憤 agreed! Looks like a good workaround that isn鈥檛 currently in risk of overwrite. They might change it in the future though. So would still recommend to beware.

@geekgonecrazy @LuluGO has this been fixed by #12351 ? or is this still relevant?

Still relevant. We added support to set environment variables for Rocket.chat primarily as well as a few config things in that PR.

So this is still something we need to look at

Was this page helpful?
0 / 5 - 0 ratings

Related issues

lunitic picture lunitic  路  3Comments

Buzzele picture Buzzele  路  3Comments

brendanheywood picture brendanheywood  路  3Comments

karlprieb picture karlprieb  路  3Comments

marceloschmidt picture marceloschmidt  路  3Comments