Re: Converting postgresql.conf parameters to kilobytes

From: pgsql(at)mohawksoft(dot)com
To: shridhar(at)frodo(dot)hserus(dot)net
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: Converting postgresql.conf parameters to kilobytes
Date: 2004-05-30 17:15:44
Message-ID: 16816.24.91.171.78.1085937344.squirrel@mail.mohawksoft.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

> Hi,
>
> I was toying around with idea of converting all the memory related
> parameters
> in postgresql.conf to kilobytes for simplicity and uniformity.
>
> Attached is a proof of concept patch that converts shared_buffers to
> kilobytes
> using assign_hook.
>
> It compiled all-right but I experienced a strange behavior. At the time of
> initdb, it demanded 69MB of shared memory. I had to bump up SHMMAX from
> 32MB
> to 128MB to get initdb through. Certainly I did something wrong somewhere
> but
> I don't know what and where. This is linux 2.6.4.
>
> The postgresql.conf is properly altered and shows 8000(Though the
> description
> around is no longer in sync.)
>
> I also don't know where to put the assign_hook. I have put in guc.c for
> the
> time being. Only other int hook I found was assign_max_stack_depth which
> is
> in postgres.c
>
> Any comments/pointers?
>
> Regards,
> Shridhar

Changing the format of numbers is tricky. I wouldn't change it, I'd allow
for a suffix, i.e. 1024K or 1M

Additionally, the configuration patch I submited and I think Bruce has
already or will merge, allows for a configuration function. A specific
keyword can be handled by a handler function. This is how I got "include"
to work, but I would modify *all* the number handlers in GUC to accept the
suffix rather than explicitly change anything that currently works. It is
more consistent, more readble i.e. 128 vs 128M.

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Heikki Linnakangas 2004-05-30 20:27:19 Re: Delaying the planning of unnamed statements until Bind
Previous Message Tom Lane 2004-05-30 16:03:58 Re: Converting postgresql.conf parameters to kilobytes