# LimitNOFILE reset on every update

**URL:** <https://forums.percona.com/t/limitnofile-reset-on-every-update/17072>\
**Category:** Percona Operator for MySQL\
**Tags:** percona, new-release\
**Created:** [August 18, 2022, 2:42am UTC](https://forums.percona.com/t/limitnofile-reset-on-every-update/17072 "2022-08-18T02:42:46Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![D\_ng\_Ti\_n\_Dung](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/d_ng_ti_n_dung/32/7251_2.png) [@D\_ng\_Ti\_n\_Dung](https://forums.percona.com/u/D_ng_Ti_n_Dung)\
**Post date:** [August 18, 2022, 2:42am UTC](https://forums.percona.com/t/limitnofile-reset-on-every-update/17072/1 "2022-08-18T02:42:46Z")

</div>

Hello Guys,

We are running Percona 5.7 on Centos 7. I found a bug that LimitNOFILE in mysqld.service that reset to 5000 everytime we update Percona. It makes to the max\_connections can’t go over 5000 and make the server in serious trouble before we update update that value and restart MySQL.

Is there anyway to avoid this issue and it would be great if Percona take a look on this issue

Thanks for your time!

---

<div class="post-metadata">

**Author:** ![Michael\_Coburn](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/michael_coburn/32/18_2.png) [@Michael\_Coburn](https://forums.percona.com/u/Michael_Coburn)\
**Post date:** [August 18, 2022, 3:40pm UTC](https://forums.percona.com/t/limitnofile-reset-on-every-update/17072/2 "2022-08-18T15:40:27Z")

</div>

Hi @D_ng_Ti_n_Dung , thank you for posting to the Percona Forums!

We intentionally set thresholds to reasonable levels, however in your case you need to extend the `LimitNOFILE` greater than the Percona defaults. The recommended method to do so is to configure with `systemctl edit` and then restart `mysqld`. What this process does is create an override file for the `mysqld.service`, because you don’t want to be changing any of the files under `/usr/lib/systemd/system`.

These are the steps to follow:

```auto
systemctl edit mysqld.service

```

Then add in the following (set your limit as you believe you need for your environment):

```auto
[Service]
LimitNOFILE=10000

```

Save and exit the editor. Then restart `mysqld`:

```auto
systemctl restart mysqld.service

```

and your new limit should be in place.

---

<div class="post-metadata">

**Author:** ![D\_ng\_Ti\_n\_Dung](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/d_ng_ti_n_dung/32/7251_2.png) [@D\_ng\_Ti\_n\_Dung](https://forums.percona.com/u/D_ng_Ti_n_Dung)\
**Post date:** [August 19, 2022, 1:23am UTC](https://forums.percona.com/t/limitnofile-reset-on-every-update/17072/3 "2022-08-19T01:23:39Z")

</div>

Thanks Michael for your advise,  
Yes, I have to change mysqld.service on every updates. But it would be great if Percona keep the current configuration when it exist or remove this not necessary configuration from mysqld.service to just use my.cnf for all mysql’s settings.

Cheers,

---

<div class="post-metadata">

**Author:** ![Michael\_Coburn](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/michael_coburn/32/18_2.png) [@Michael\_Coburn](https://forums.percona.com/u/Michael_Coburn)\
**Post date:** [August 19, 2022, 1:59pm UTC](https://forums.percona.com/t/limitnofile-reset-on-every-update/17072/4 "2022-08-19T13:59:35Z")

</div>

So to be clear @D_ng_Ti_n_Dung - you are already using the override method `systemctl edit mysqld.service` and this is being changed on upgrade?
