Re: Units in postgresql.conf - Mailing list pgsql-hackers

From Zdenek Kotala
Subject Re: Units in postgresql.conf
Date
Msg-id 44BFA67F.5050007@sun.com
Whole thread Raw
In response to Units in postgresql.conf  (Peter Eisentraut <peter_e@gmx.net>)
Responses Re: Units in postgresql.conf  (Peter Eisentraut <peter_e@gmx.net>)
List pgsql-hackers
Peter Eisentraut wrote:
> One frequent source of confusion are the different units that the parameters 
> in postgresql.conf use.  shared_buffers is in 8 kB, work_mem is in 1 kB; 
> bgwriter_delay is in milliseconds, checkpoint_warning is in seconds.  
> Obviously, we can't change that without inconveniencing a lot of users.
> 
> I think it would be useful to allow units to be added to these settings, for 
> example
> 
> shared_buffers = 1000kB
> checkpoint_warning = 30s
> 
> This would also allow
> 
> shared_buffers = 512MB
> 
> which is a bit cumbersome to calculate right now (you'd need = 65536).
> 
> I haven't thought yet how to parse or implement this, but would people find 
> this useful?
> 

It is good idea. I going to implement this. There is some proposal:


Time units is easy:
1h = 60min = 3600s = 3600000ms


Memory units:
What kind of unit prefix will we use for memory?  1kB=1000B and 
1kiBi=1024B  or 1kB=1024kB. See 
http://en.wikipedia.org/wiki/Binary_prefix for detail. I suggest use IEC 
standard convention. By my opinion it is much better.


And there are some other questions:
1) will be unit required? What will be default unit for value without unit?

I suggest mandatory unit avoid the problem with unclear default value.

2) Each internal representation of setting use different unit. Shell I 
convert this representation to milliseconds and bytes? I think it is not 
good idea. It should generate some overflow. I suggest to recompute 
value and round it to integer.

    Zdenek




pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: float8 regression failure (HEAD, cygwin)
Next
From: "moises"
Date:
Subject: Real Time Data Base using Postgre