X-Original-To: pgsql-admin@postgresql.org Received: from mail.virginia.edu (mail.Virginia.EDU [128.143.2.9]) by postgresql.org (Postfix) with SMTP id 92842475CE5 for ; Wed, 5 Mar 2003 14:24:56 -0500 (EST) Received: from smtp.mail.virginia.edu by mail.virginia.edu id ab13054; 5 Mar 2003 14:24 EST Received: from jlk3xpc (d-128-19-222.bootp.Virginia.EDU [128.143.19.222]) by smtp.mail.Virginia.EDU (8.11.6p/8.11.6) with SMTP id h25JNTh07046 for ; Wed, 5 Mar 2003 14:23:29 -0500 Message-ID: <015601c2e34d$81ab7680$de138f80@virginia.edu> From: Jodi Kanter To: pgsql-admin References: <88A3CE9B-4F3F-11D7-896A-0003933DD370@h-e.com> Subject: Re: Followup Re: Performance question Date: Wed, 5 Mar 2003 14:29:14 -0500 MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 6.00.2800.1106 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1106 X-Archive-Number: 200303/38 X-Sequence-Number: 7686 Is restarting postmaster on a regular basis necessary for performance? ----- Original Message ----- From: "Bob Smith" To: "pgsql-admin" Sent: Wednesday, March 05, 2003 2:20 PM Subject: Followup Re: [ADMIN] Performance question > > OK, I seem to have fixed my own problem here again, sorry. I restarted > the postmaster, now _all_ queries are about 10x faster, and the first > execution on a new connection is no longer significantly slower than > the second. The server (and the original postmaster) had been up for: > > 11:18AM up 162 days, 17:48, 3 users, load averages: 0.57, 0.51, 0.51 > > Maybe I should have a cron script restart postmaster every now and > then, like once a week? > > Bob > > On Wednesday, Mar 5, 2003, at 10:11 US/Pacific, Bob Smith wrote: > > > > > When I execute a query on a new connection, the performance is many > > times slower than if the query is repeated. In other words, if I > > start psql, execute the query, then repeat it immediately, the second > > time it takes only about 20% as long to execute. Now here's the > > confusing part, if I exit psql then start it up again, the same thing > > will occur on the new connection as well, the first execution takes 5x > > as long again. I don't understand this, it would make sense to me > > that the second execution being faster is due to disk caching on the > > server, but then why is it slower again on every new connection? Disk > > caching should benefit all current and new connections until the cache > > is flushed, which on this server shouldn't happen for a long time, the > > load is light and it has lots of RAM. Is Postgres doing some kind of > > caching itself that lasts only for the life of one backend process? > > If so, is there any way to make this caching persistent across > > backends? > > > > Server particulars: > > > > Postgres 7.2.1, Mac OS X Server 10.1.5, dual 1GHz CPUs, 1.5GB memory > > > > Thanks! > > > > Bob Smith > > Hammett & Edison, Inc. > > bsmith@h-e.com > > > > > > ---------------------------(end of > > broadcast)--------------------------- > > TIP 3: if posting/reading through Usenet, please send an appropriate > > subscribe-nomail command to majordomo@postgresql.org so that your > > message can get through to the mailing list cleanly > > > > > ---------------------------(end of broadcast)--------------------------- > TIP 4: Don't 'kill -9' the postmaster >