Rocket.Chat icon indicating copy to clipboard operation
Rocket.Chat copied to clipboard

How to increase file descriptors in Caddy service within Snap?

Open gregs007 opened this issue 9 years ago • 9 comments

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?

gregs007 avatar May 15 '17 22:05 gregs007

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.

geekgonecrazy avatar May 17 '17 00:05 geekgonecrazy

Thank you!

gregs007 avatar May 17 '17 01:05 gregs007

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>

mohag avatar Oct 08 '18 08:10 mohag

Your solution work fine! tnx

pixsysedp avatar Nov 21 '18 16:11 pixsysedp

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

geekgonecrazy avatar Nov 27 '18 07:11 geekgonecrazy

Beware that doing this might go away with snap updates. As I know snap does generate the unit file. Maybe it doesn’t 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...

mohag avatar Dec 03 '18 12:12 mohag

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

geekgonecrazy avatar Dec 03 '18 15:12 geekgonecrazy

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

marceloschmidt avatar Jan 03 '19 13:01 marceloschmidt

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

geekgonecrazy avatar Jan 04 '19 01:01 geekgonecrazy