Connection hangs on new created schema

From: Juan Manuel Cuello <juanmacuello(at)gmail(dot)com>
To: pgsql-general(at)lists(dot)postgresql(dot)org
Subject: Connection hangs on new created schema
Date: 2018-03-27 21:46:16
Message-ID: CALXCfb094RkO5nosjUpUSXL0asSqio9XeRWHf02gX0SB4JUJGg@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

I have a postgresql database with around 4000 schemas. Each schema has
around the same 65 tables. There are 8 processes connected to the database
(it is a web app). Each process has only one direct connection to the
database (no connection pool).

Everything works ok until a new schema (with all its tables, indices, etc)
is added to the database. When this happens, the next query made to the
database takes too long, sometimes more than a minute o two. Also I see a
high DB CPU usage during that lapse. Then everything continues working ok
as usual and CPU drops to normal levels.

I'm mostly sure this has to do with the amount of schemas, maybe related to
relcache, but not sure why creating new schemas causes all this and where
to look to solve this problem.

i can see also the server hast a lot of free memory and is no swapping at
all.

OS: Linux
Server version: 9.3.20

Any insight will be highly appreciated.

Responses

Browse pgsql-general by date

  From Date Subject
Next Message armand pirvu 2018-03-27 21:55:30 Re: Proposition for better performance
Previous Message Paul Jungwirth 2018-03-27 21:25:26 Re: Proposition for better performance