cgwire / zou

Zou is the Kitsu API. It allows you to store and manage your production data
https://zou.cg-wire.com
GNU Affero General Public License v3.0
162 stars 102 forks source link

Huge load on instance and multiple DB connections when adding project or amending project settings #801

Open PeteDraper opened 3 months ago

PeteDraper commented 3 months ago

Studio name: Ryff Kitsu version: 0.19.25 Production type: TV Show

recently have noticed that when creating a project, the instance goes absolutely crazy (see screenshot of the box's htop) and hangs for a lot of people (about 20 connected at any time) and often kicks them out and/or the api can't be found.

We have around 50 open projects and about 3x as many closed ones. It often takes about 15 mins for the postgres to settle down and allow people back in or to perform at normal speeds.

Am using the default postgres settings (should I increase the number of connections? - default is 30 with overflow of 60)

I should also mention that up until the last month we didn't have this issue. Amending any of the project's settings like adding Automations and Team Members is causing the same large load on the system for several minutes; not as many connections but still a substantial load.

Our database is quite large - last backup was a 150Mb gz file so am not sure if the size of our DB is the issue (edited: incorrectly mentioned 150Gb, not Mb)

Note that this issue is only occurring when creating the project or amending the project's settings

Screenshot 2024-04-22 at 18 09 19
PeteDraper commented 3 months ago

adding Team members from previous project also causes overload in connections and immediate boot out to login screen