X-Original-To: pgsql-hackers@postgresql.org Received: from localhost (postgresql.org [64.49.215.8]) by postgresql.org (Postfix) with ESMTP id 8FEFB475F31 for ; Fri, 14 Feb 2003 16:59:46 -0500 (EST) Received: from post.webmailer.de (natsmtp01.webmailer.de [192.67.198.81]) by postgresql.org (Postfix) with ESMTP id E2E8E47601E for ; Fri, 14 Feb 2003 16:54:37 -0500 (EST) Received: from dell (p5091772C.dip.t-dialin.net [80.145.119.44]) by post.webmailer.de (8.9.3/8.8.7) with ESMTP id WAA04790; Fri, 14 Feb 2003 22:54:27 +0100 (MET) Content-Type: text/plain; charset="iso-8859-1" From: Tilo Schwarz To: Bruce Momjian Subject: Re: Changing the default configuration (was Re: [pgsql-advocacy] Date: Fri, 14 Feb 2003 22:55:51 +0100 User-Agent: KMail/1.4.3 References: <200302131710.h1DHAui22918@candle.pha.pa.us> In-Reply-To: <200302131710.h1DHAui22918@candle.pha.pa.us> Cc: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Message-Id: <200302142255.51683.mail@tilo-schwarz.de> X-Virus-Scanned: by AMaViS new-20020517 X-Archive-Number: 200302/825 X-Sequence-Number: 35766 Bruce Momjian writes: > Tom Lane wrote: > > Bruce Momjian writes: > > > So, my idea is to add a message at the end of initdb that states peop= le > > > should run the pgtune script before running a production server. > > > > Do people read what initdb has to say? > > > > IIRC, the RPM install scripts hide initdb's output from the user > > entirely. I wouldn't put much faith in such a message as having any > > real effect on people... > > Yes, that is a problem. We could show something in the server logs if > pg_tune hasn't been run. Not sure what else we can do, but it would > give folks a one-stop thing to run to deal with performance > configuration. > > We could prevent the postmaster from starting unless they run pg_tune or > if they have modified postgresql.conf from the default. Of course, > that's pretty drastic. I don't think, that's drastic, if it's done in a user friendy way ;-): I work with Postgresql for half a year now (and like it very much), but I m= ust=20 admit, that it takes time to understand the various tuning parameters (what= =20 is not surprising, because you need understand to a certain degree, what's= =20 going on under the hood). Now think of the following reasoning: - If the resouces of a system (like shared mem, max open files etc.) are no= t=20 known, it's pretty difficult to set good default values. That's why it is s= o=20 difficult to ship Postgresql with a postgresql.conf file which works nicely= =20 on all systems on this planet. - On the other hand, if the resouces of a system _are_ known, I bet the peo= ple=20 on this list can set much better default values than any newbie or a static= =20 out-of-the-box postgresql.conf. Thus the know how which is somehow in the heads of the gurus should be=20 condensed into a tune program which can be run on a system to detect the=20 system resources and which dumps a reasonable postgresql.conf. Those defaul= ts=20 won't be perfect (because the application is not known yet) but much better= =20 than the newbie or out-of-the-box settings. If the tune program detects, that the system resouces are so limited, that = it=20 makes basically no sense to run Postgresql there, it tells the user what th= e=20 options are: Increase the system resources (and how to do it if possible) o= r=20 "downtune" the "least reasonable" postgresql.conf file by hand. Given the= =20 resources of average systems today, the chances are much higher, that users= =20 leave Postgresql because "it's slower than other databases" than that they= =20 get upset, because it doesn't start right away the first time. Now how to make sure, the tune program gets run before postmaster starts th= e=20 first time? Prevent postmaster from starting, unless the tune program was r= un=20 and fail with a clear error message. The message should state, that the tun= e=20 program needs to be run first, why it needs to be run first and the command= =20 line showing how to do that. If I think back, I would have been happy to see such a message, you just co= py=20 and paste the command to your shell, run the command and a few seconds late= r=20 you can restart postmaster with resonable settings. And the big distributor= s=20 have their own scipts anyway, so they can put it just before initdb. Regards, Tilo