"too many open files" after few days

I’ve got runnnig matternost 3.1 under Centos 7.2, there are 211 members, most of them are active.
Constantly after 2-3-4 days I start to get error messages in log like this:

[2016/06/29 12:09:15 MSK] [EROR] /api/v3/users/cewojitd7pn7drbwxu56c9xsph/image:createProfileImage code=500 rid=tybi8g9hqiyzdper8forsuxhpa uid=seq8mnj73jb5mef5bie9doz31y ip=XXXXX Could not create default profile image font [details: open /opt/mattermost/fonts/luximbi.ttf: too many open files]

and clients start to lose connections. Solution is restarting mattermost service, so I have to do that every few days.

Mattermost running under root user(I need run mattermost on 80, by the way, are there any solutions to run in 80 without root privelegies?)

Root user has these limits:

ulimit -Hn


ulimit -Sn


At moment I get error messages I can see mattermost has about 15-16 thousands of openned files:

lsof | grep platform | wc -l


The same troubles I had with 3.0.2 version

So, Is it mattermost bug or configuration bug?

Hi @andrey,

Thanks for reporting this! It looks like there were some HTTP requests being made (mainly due to push notifications but also in some other places) that were the cause of this due to some non-closed responses.

I’ve submitted a pull request here to get the issue fixed which should release with v3.3.