Page 1 of 1

TOS 5 Big Process "postgres" ( SQL ) CPU HIGH

Posted: 17 Jul 2022, 22:23
by gretor
I installed TOS 5 and after I installed Terra Search, the CPU was continuously spinning at 100%. Since I read that this is still a bug, I uninstalled the APP. Since the CPU load did not change, I decided to reinstall TOS 5.

Unfortunately, this also shows a CPU that is completely overloaded from the beginning. For some reason the postgres process is running at full load all the time, taking away the CPU's breathing room and using up an enormous amount of system resources. The Terra Master is therefore difficult to use.

Is this a known bug ? What is the reason ? Can I fight the problem via SSH without compromising the NAS privacy ?

gretor

>Name User ID CPU Memory
postgres postgres 10354 6.61% 0.72%
postgres postgres 10266 6.03% 0.71%
postgres postgres 10267 6.02% 0.71%
postgres postgres 10268 5.77% 0.71%
postgres postgres 10269 5.77% 0.72%
postgres postgres 10221 5.54% 0.72%
postgres postgres 10215 4.96% 0.71%
postgres postgres 10214 4.61% 0.71%
postgres postgres 10209 4.17% 0.71%
postgres postgres 10460 31.11% 0.72%
postgres postgres 10208 3.87% 0.71%
TOSDaemon TOS-Qosmio 4757 3.13% 3.82%
postgres postgres 10186 2.77% 0.71%
postgres postgres 10185 2.66% 0.72%
postgres postgres 10459 15.68% 0.72%
postgres postgres 10166 1.94% 0.71%
postgres postgres 10172 1.88% 0.71%
[restart_service] TOS-Qosmio 2730 1.60% 0.41%
postgres postgres 10164 1.45% 0.71%
postgres postgres 10149 1.43% 0.72%
postgres postgres 10139 1.20% 0.71%
postgres postgres 10124 1.18% 0.71%

Re: TOS 5 Big Process "postgrel" ( SQL ) CPU HIGH

Posted: 30 Jul 2022, 12:46
by TMroy
I would like to respond to all topics related to process "postgres":

1. From TOS 5, a new database postgres has been implemented into the system, there are a lot of services and apps that need to read or write the database. So if you see many "postgres" processes running, please do NOT be surprised, it is a normal case.

2. Because it is reading and writing the database, each "postgres" process will occupy a very small CPU resource and each process will automatically exit after a short period of time.

3. If you find that one or some "postgress" processes take up a lot of CPU resources(over 50%) for a long time(over 30 minutes), it is possible that these processes are stuck for some reason. If this happens, you can export the process list and send it to us for analysis.
exportlist.png

Re: TOS 5 Big Process "postgres" ( SQL ) CPU HIGH

Posted: 31 Jul 2022, 03:59
by titanrx8
Based on TM comments on the postgres CPU consumption in another thread, I did some checking.

When I log in as a user with admin privileges, the CPU consumption will hit 100% for days non-stop. There will be 69 postgres processes with consumption as high as 45% for one of the instances (and it doesn't disappear after 30 minutes).

If I log out of that user and log in as the super-user, the CPU consumption will be nominal and there will be 15 instances of postgres but none of the instances exceeds 1%. The system is responsive and usable.

Here's my question. Which accounts are we supposed to use? I thought that we were supposed to create admin privilege users and log in using that user instead of the superuser in order to safeguard against ransomware. But, when I login using the admin privilege user, the system becomes totally unresponsive because of the 100% CPU.

This is f2-221 currently on 5.0.144

Re: TOS 5 Big Process "postgres" ( SQL ) CPU HIGH

Posted: 01 Aug 2022, 15:05
by TMroy
{L_BUTTON_AT}titanrx8
Thank you for your report! We have found the cause of the issue, it will be fixed in near future updates.

Re: TOS 5 Big Process "postgres" ( SQL ) CPU HIGH

Posted: 02 Aug 2022, 06:27
by titanrx8
@tmroy
Another observation: it seems that every new user that gets created will have Media Indexing enabled by default which also kicks off heavy cpu consumption. For my purposes, Media Index is not needed on this backup system so I need to remember to disable media indexing if I create any more users.

Re: TOS 5 Big Process "postgres" ( SQL ) CPU HIGH

Posted: 03 Sep 2022, 13:43
by chourmovs
titanrx8 wrote: 02 Aug 2022, 06:27 @tmroy
Another observation: it seems that every new user that gets created will have Media Indexing enabled by default which also kicks off heavy cpu consumption. For my purposes, Media Index is not needed on this backup system so I need to remember to disable media indexing if I create any more users.
Confirming and agreeing for Both PostgreSQL make things sluggish and media indexing could be disabled by default

Re: TOS 5 Big Process "postgres" ( SQL ) CPU HIGH

Posted: 05 Sep 2022, 21:16
by Dadbart
I also have the issue with mediaindex running away with the CPU. I don't use Multimedia Server (I use Plex) or photos, so I disabled it and the CPU returned to 2-3%. Running latest stable release 5.0.163. Not fixed yet it appears. It did say the Index had completed a day previous to today. I just updated to 5 yesterday.