Received: from dmz2.unibox.ptinovacao.pt (unibox.ptinovacao.pt [194.65.138.76]) by postgresql.org (Postfix) with ESMTP id D8F68474E6D for ; Wed, 24 Jul 2002 21:18:04 -0400 (EDT) Received: from uniboxow.ptinovacao.pt ([10.80.50.202]) by dmz2.unibox.ptinovacao.pt (8.9.3/8.9.3) with SMTP id BAA24702 for ; Thu, 25 Jul 2002 01:48:12 +0100 Received: (qmail 28224 invoked by uid 0); 25 Jul 2002 01:14:43 -0000 Received: from unknown (HELO sargao) ([unknown]) (envelope-sender ) by unknown (qmail-ldap-1.03) with SMTP for ; 25 Jul 2002 01:14:43 -0000 Subject: Re: Postgres performance slowly gets worse over a month From: Marcos Garcia To: pgsql-admin In-Reply-To: <1027519476.8302.11.camel@camel> References: <4.2.2.20020723110231.01daf8c0@ecint.ecinet.com> <1027448992.25561.25.camel@skymaster> <1027448282.15044.24.camel@sargao> <3D3DC06C.8010707@vpmonline.com> <015601c23303$58a63040$d60ffea9@GMENDOLA2> <1027519476.8302.11.camel@camel> Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="=-l6bBfrVPL7UYrJ6oSyVJ" X-Mailer: Ximian Evolution 1.0.8 Date: 25 Jul 2002 01:17:59 +0100 Message-Id: <1027556279.17709.48.camel@sargao> Mime-Version: 1.0 X-Archive-Number: 200207/351 X-Sequence-Number: 5035 --=-l6bBfrVPL7UYrJ6oSyVJ Content-Type: multipart/mixed; boundary="=-7gtIMh1D78yXFFB0IegP" --=-7gtIMh1D78yXFFB0IegP Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Since this conversation had started, the presented solutions for the disk space (disk space of tables and indexes) problem were: - reindex -> no space recovered - frequent vacuums -> some space recovered, meanwhile the database keeps growing - vacuumm full -> some space recovered, meanwhile the database keeps growing, quite similar to simple vacuum. we have also to keep in mind, that the option "full", makes locks to the tables. Therefore, the services around the database locks too, and with the growing of the database the time spent for "vacumm full" increases, as well as the downtime of the services around the database. So, my doubts are: - There's nothing we can do to avoid the growth of the database, only slow down that growth. =20 - We, application developers that use postgresql databases have to count with this problem. Sorry if i'm being a little rude, but i'm in a real trouble. Thanks in advance, M.P.Garcia On Wed, 2002-07-24 at 15:04, Robert Treat wrote: > This is before my morning coffee, so someone please correct me if I am > wrong, but that should be the amount of space in your table that is > available for reuse before new pages need to be added. Whether it is > actually used is determined by a combination of factors including the > amount of insert/update activity on your system and the size of your > free space map. If you want to recover all of that space, you'll need to > do a vacuum full. As it looks now you could probably start vacuuming > this table more frequently to keep this number from growing so quickly. >=20 > Robert Treat >=20 > On Wed, 2002-07-24 at 07:14, Gaetano Mendola wrote: > >=20 > > "Michael G. Martin" wrote: > > > Check this value in the postgresql.con file: > > > > > > max_fsm_pages =3D 100000 > > > > > > I had the same problem with the db growing, index no longer being use= d, > > > despite vacuums each night. Somewhere, there is a thread on this. > > > > > > Anyway, If you look at the vacuum stats each time your run vacuum, lo= oks > > > to see how many pages are being updated between vacuums--i looked at = the > > > removed x tuples in y pages value. Then, set this value to be greater > > > than the number of pages changed between vacuums. If more pages are > > > being updated between vacuums than what max_fsm_pages allows, the ext= ra > > > pages won't be marked to be re-used--from what I understand. This th= en > > > results in the db growing and the optimizer starts to chose full table > > > scans since the db spans so many pages on the disk--at least this is > > > what happened in my db. > >=20 > >=20 > > Can you explain me this line that I obatin in the log > > after a vacuum analyze ? > >=20 > > --Relation ua_user_data_exp-- > > 2002-07-21 05:00:02 [28492] DEBUG: Pages 1402: Changed 2, reaped 1192, > > Empty 0, New 0; Tup 4277: Vac 16207, Keep/VTL 0/0, Crash 0, UnUsed 1, M= inLen > > 393, MaxLen 680; Re-using: Free/Avail. Space 9148944/9141356; > > EndEmpty/Avail. Pages 0/1191. CPU 0.00s/0.03u sec. > >=20 > > I'm wondering about "Re-using: Free/Avail. Space 9148944/9141356" > >=20 > >=20 > > Ciao > > Gaetano > >=20 > >=20 > > ---------------------------(end of broadcast)--------------------------- > > TIP 6: Have you searched our list archives? > >=20 > > http://archives.postgresql.org >=20 >=20 >=20 >=20 > ---------------------------(end of broadcast)--------------------------- > TIP 4: Don't 'kill -9' the postmaster --=20 M.P.Garcia PT Inova=E7=E3o, SA Servi=E7os e Redes M=F3veis=20 Rua Jos=E9 Ferreira Pinto Basto - 3810 Aveiro Tel: 234 403 253 - Fax: 234 424 160 E-mail: marcos-p-garcia@ptinovacao.pt --=-7gtIMh1D78yXFFB0IegP Content-Type: application/pgp-signature; name=signature.asc Content-Description: This is a digitally signed message part Content-Transfer-Encoding: base64 LS0tLS1CRUdJTiBQR1AgU0lHTkFUVVJFLS0tLS0KVmVyc2lvbjogR251UEcg djEuMC42IChHTlUvTGludXgpCkNvbW1lbnQ6IEZvciBpbmZvIHNlZSBodHRw Oi8vd3d3LmdudXBnLm9yZwoKaUQ4REJRQTlQeWtOR1JJckxxbEFWZzBSQWdQ cUFKOVlsL2hFbStnZWpBelNHSEZMSExsZWQ0TVA2Z0NmZXdQUwpBdlRiQWlQ d3R0TS9oaFl1djgwTTBCYz0KPVBaQTYKLS0tLS1FTkQgUEdQIFNJR05BVFVS RS0tLS0tCg== --=-7gtIMh1D78yXFFB0IegP-- --=-l6bBfrVPL7UYrJ6oSyVJ Content-Type: application/pgp-signature; name=signature.asc Content-Description: This is a digitally signed message part -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.0.6 (GNU/Linux) Comment: For info see http://www.gnupg.org iD8DBQA9P0O2GRIrLqlAVg0RAt3IAKCPNIquMKOZ5qf2FV7bJITYLRA77ACeI2jh MmZd31O5Uk4YXHm4jok/jgA= =Yb8v -----END PGP SIGNATURE----- --=-l6bBfrVPL7UYrJ6oSyVJ--