# "too many open files" after few days

**URL:** <https://forum.mattermost.com/t/too-many-open-files-after-few-days/1791>\
**Category:** Troubleshooting\
**Created:** [June 29, 2016, 9:33am UTC](https://forum.mattermost.com/t/too-many-open-files-after-few-days/1791 "2016-06-29T09:33:13Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![andrey](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mattermost.com/andrey/32/777_2.png) [@andrey](https://forum.mattermost.com/u/andrey)\
**Post date:** [June 29, 2016, 9:33am UTC](https://forum.mattermost.com/t/too-many-open-files-after-few-days/1791/1 "2016-06-29T09:33:13Z")

</div>

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
> 
> 100000

> # ulimit -Sn
> 
> 100000

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

> # lsof | grep platform | wc -l
> 
> 15450

The same troubles I had with 3.0.2 version

So, Is it mattermost bug or configuration bug?

---

<div class="post-metadata">

**Author:** ![jwilander](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mattermost.com/jwilander/32/8440_2.png) [@jwilander](https://forum.mattermost.com/u/jwilander)\
**Post date:** [July 4, 2016, 2:28pm UTC](https://forum.mattermost.com/t/too-many-open-files-after-few-days/1791/2 "2016-07-04T14:28:51Z")

</div>

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](https://github.com/mattermost/platform/pull/3469) to get the issue fixed which should release with v3.3.
