# High Load on Postgres Database

**URL:** <https://help.nextcloud.com/t/high-load-on-postgres-database/100094>\
**Category:** ℹ️ Support\
**Created:** [December 3, 2020, 10:48am UTC](https://help.nextcloud.com/t/high-load-on-postgres-database/100094 "2020-12-03T10:48:03Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![vatolin](https://help.nextcloud.com/user_avatar/help.nextcloud.com/vatolin/32/43311_2.png) [@vatolin](https://help.nextcloud.com/u/vatolin)\
**Post date:** [December 3, 2020, 10:48am UTC](https://help.nextcloud.com/t/high-load-on-postgres-database/100094/1 "2020-12-03T10:48:03Z")

</div>

My NC is hosted on a dedicated virtual server. I have no sudo permissions on the server. Now the hosting provider told me the Postgres database of my NC causes high load on the database.

How can I find what causes this issue and how to solve it?

---

<div class="post-metadata">

**Author:** ![j-ed](https://help.nextcloud.com/user_avatar/help.nextcloud.com/j-ed/32/7281_2.png) [@j-ed](https://help.nextcloud.com/u/j-ed)\
**Post date:** [December 3, 2020, 10:51am UTC](https://help.nextcloud.com/t/high-load-on-postgres-database/100094/2 "2020-12-03T10:51:47Z")

</div>

> [@vatolin](#):
>
> How can I find what causes this issue and how to solve it?

A high database load is very often being caused by using the database for all file locking activities. If you install and use e.g. Redis for the [**file locking**](https://docs.nextcloud.com/server/20/admin_manual/configuration_server/caching_configuration.html?highlight=redis#id2) the database load should go done.

---

<div class="post-metadata">

**Author:** ![vatolin](https://help.nextcloud.com/user_avatar/help.nextcloud.com/vatolin/32/43311_2.png) [@vatolin](https://help.nextcloud.com/u/vatolin)\
**Post date:** [December 3, 2020, 12:11pm UTC](https://help.nextcloud.com/t/high-load-on-postgres-database/100094/3 "2020-12-03T12:11:59Z")

</div>

> [@j-ed](#):
>
> file locking activities

I think NC does not lock the files in my NC, because I use in the web interface the filebrowser of NC. So, where can I see what the database currently is doing? In the administrator section of my NC web interface I can see in the system panel a workload of appr. 4.33-6.97 within the last minute. What does this number stands for?

---

<div class="post-metadata">

**Author:** ![j-ed](https://help.nextcloud.com/user_avatar/help.nextcloud.com/j-ed/32/7281_2.png) [@j-ed](https://help.nextcloud.com/u/j-ed)\
**Post date:** [December 3, 2020, 12:16pm UTC](https://help.nextcloud.com/t/high-load-on-postgres-database/100094/4 "2020-12-03T12:16:01Z")

</div>

> [@vatolin](#):
>
> I think NC does not lock the files in my NC, because I use in the web interface the filebrowser of NC.

That’s a strange logic. It doesn’t matter if you use the web interface or not, Nextcloud always uses a file locking to prevent any problems if files are being accessed. Check your Nextcloud configuration file if and how file locking has been configured.

---

<div class="post-metadata">

**Author:** ![vatolin](https://help.nextcloud.com/user_avatar/help.nextcloud.com/vatolin/32/43311_2.png) [@vatolin](https://help.nextcloud.com/u/vatolin)\
**Post date:** [December 3, 2020, 12:35pm UTC](https://help.nextcloud.com/t/high-load-on-postgres-database/100094/5 "2020-12-03T12:35:22Z")

</div>

> [@j-ed](#):
>
> file locking

Probably I misunderstood you. Do we talk about server side encryption? I’ve heard, there would be not file access via web interface when server side encryption is enabled.

> [@](#):
>
> how file locking has been configured

Where will I find the respective information?

---

<div class="post-metadata">

**Author:** ![j-ed](https://help.nextcloud.com/user_avatar/help.nextcloud.com/j-ed/32/7281_2.png) [@j-ed](https://help.nextcloud.com/u/j-ed)\
**Post date:** [December 3, 2020, 1:21pm UTC](https://help.nextcloud.com/t/high-load-on-postgres-database/100094/6 "2020-12-03T13:21:03Z")

</div>

> [@vatolin](#):
>
> Where will I find the respective information?

That’s easy, you only have to follow the link in my primary posting to jump directly to the Nextcloud administrator guide 😉

---

<div class="post-metadata">

**Author:** ![vatolin](https://help.nextcloud.com/user_avatar/help.nextcloud.com/vatolin/32/43311_2.png) [@vatolin](https://help.nextcloud.com/u/vatolin)\
**Post date:** [December 4, 2020, 7:21pm UTC](https://help.nextcloud.com/t/high-load-on-postgres-database/100094/7 "2020-12-04T19:21:23Z")

</div>

I will follow this instruction:

> [@File is locked - how to unlock](https://help.nextcloud.com/t/file-is-locked-how-to-unlock/1883):
>
> You can’t access files because they are locked and you find such errors in your logfile: {"reqId":"0DijSqEkfOg2iyh9VD8J","remoteAddr":"xx.xx.xx.xx","app":"webdav","message":"Exception: {\"Message\":\"HTTP\\\/1.1 423 \\\"path\\\/file.extension\\\" is locked\",\"Exception\":\"OCA\\\\DAV\\\\Connector\\\\Sabre\\\\Exception\\\\FileLocked\",\"Code\":0,\"Trace\":\"#0 Manually disable locking state: put Nextcloud in maintenance mode: edit config/config.php and change this line: 'maintenance' =\> tr…

But I dont know how to connect directly to my database. I know the name of the database. But I do not know how to connnect _directly_ to it.

Could you please give me some advice?

---

<div class="post-metadata">

**Author:** ![j-ed](https://help.nextcloud.com/user_avatar/help.nextcloud.com/j-ed/32/7281_2.png) [@j-ed](https://help.nextcloud.com/u/j-ed)\
**Post date:** [December 5, 2020, 10:17am UTC](https://help.nextcloud.com/t/high-load-on-postgres-database/100094/8 "2020-12-05T10:17:14Z")

</div>

> [@vatolin](#):
>
> But I dont know how to connect directly to my database. I know the name of the database. But I do not know how to connnect _directly_ to it.

Unfortunately you didn’t provide the usual information about your environment, used software versions, configuration, log file excerpts, etc., etc. Therefore I cannot tell you how you can connect to your database, because this information can be found in the Nextcloud configuration file.

Beside this you find information about how to connect to a PostgreSQL database on the internet:

[https://www.google.com/search?client=firefox-b-d&q=postgresql+connect+to+database](https://www.google.com/search?client=firefox-b-d&q=postgresql+connect+to+database)

---

<div class="post-metadata">

**Author:** ![vatolin](https://help.nextcloud.com/user_avatar/help.nextcloud.com/vatolin/32/43311_2.png) [@vatolin](https://help.nextcloud.com/u/vatolin)\
**Post date:** [December 13, 2020, 8:24pm UTC](https://help.nextcloud.com/t/high-load-on-postgres-database/100094/9 "2020-12-13T20:24:26Z")

</div>

I’ve found what has caused the problem and the solution too. It was the LOCKED 423 failure. And  
`DELETE FROM oc_file_locks WHERE 1`  
has it fixed.

---

<div class="post-metadata">

**Author:** ![wwe](https://help.nextcloud.com/user_avatar/help.nextcloud.com/wwe/32/72963_2.png) [@wwe](https://help.nextcloud.com/u/wwe)\
**Post date:** [December 12, 2024, 7:52pm UTC](https://help.nextcloud.com/t/high-load-on-postgres-database/100094/10 "2024-12-12T19:52:10Z")

</div>



---

<div class="post-metadata">

**Author:** ![wwe](https://help.nextcloud.com/user_avatar/help.nextcloud.com/wwe/32/72963_2.png) [@wwe](https://help.nextcloud.com/u/wwe)\
**Post date:** [December 12, 2024, 7:52pm UTC](https://help.nextcloud.com/t/high-load-on-postgres-database/100094/11 "2024-12-12T19:52:12Z")

</div>


