Re: Units in postgresql.conf

Поиск
Список
Период
Сортировка
От Zdenek Kotala
Тема Re: Units in postgresql.conf
Дата
Msg-id 44BFA67F.5050007@sun.com
обсуждение исходный текст
Ответ на Units in postgresql.conf  (Peter Eisentraut <peter_e@gmx.net>)
Ответы Re: Units in postgresql.conf  (Peter Eisentraut <peter_e@gmx.net>)
Список 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 по дате отправления:

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: float8 regression failure (HEAD, cygwin)
Следующее
От: "moises"
Дата:
Сообщение: Real Time Data Base using Postgre