Re: Extreme slowdown querying system tables

From: Craig James <cjames(at)emolecules(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: pgsql-admin(at)postgresql(dot)org
Subject: Re: Extreme slowdown querying system tables
Date: 2018-02-03 00:23:00
Message-ID: CAFwQ8rfRRmBv92YEh7EOrXKDpvD_smqJB2k3PPUvBRy0zjbt=g@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin

On Fri, Feb 2, 2018 at 3:52 PM, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:

> Craig James <cjames(at)emolecules(dot)com> writes:
> > A Chinese attacker out to steal massive amounts of our curated data
> > attacked our website/database in a way that created a new user account on
> > every access, which includes a couple tables per user. Bottom line: about
> > 3.5 million tables were created.
>
> Ugh.
>
> > After we tightened our new-user signup
> > procedure, all of the bogus accounts were deleted. Now the entire system
> > (about 400 schemas) contains about 300,000 tables total, which is roughly
> > where it's been for several years.
> > However, the system tables haven't recovered; see the highlighted time.
>
> Yeah, you'll have a whole lot of bloat in the catalogs. You'll probably
> have to do a VACUUM FULL of at least pg_class and pg_attribute to get
> back to normal. Unfortunately, there's no way to do that without an
> exclusive lock, which will be tantamount to an outage. Hope you can
> schedule some downtime.
>
> > I'm reluctant to do a VACUUM FULL and REINDEX, for fear that an exclusive
> > lock will halt the system (or that you shouldn't do this to system
> tables).
>
> It's safe, and you would not need to REINDEX because the VACUUM would
> rebuild the table's indexes anyway. But no way around the lock :-(
>

Thanks. That's exactly what I needed to know. We'll schedule some down time.

Craig

>
> regards, tom lane
>

--
---------------------------------
Craig A. James
Chief Technology Officer
eMolecules, Inc.
---------------------------------

In response to

Browse pgsql-admin by date

  From Date Subject
Next Message bob gailer 2018-02-03 20:58:06 PG Admin questions
Previous Message Tom Lane 2018-02-02 23:52:36 Re: Extreme slowdown querying system tables