Re: PostgreSQL Lite for low-end/embedded systems (16MB of total memory)

Lists: pgsql-general
From: Raphael Bossek <raphael(dot)bossek(at)gmx(dot)de>
To: pgsql-general(at)postgresql(dot)org
Subject: PostgreSQL Lite for low-end/embedded systems (16MB of total memory)
Date: 2002-06-30 10:51:40
Message-ID: 20020630105139.GA13340@mars
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-general

Hi,

do someone address the possibility to get the PostgreSQL
working on systems or environments where the total memory
does not exceed 16MB?

We intent to use PostgreSQL for our next product because it
offer the possibilities we are looking for but we need not
all of them, e.g. networking, extensibility or stand-alone
server capabilities are some of the features which are not
of interest for this project. Instead we have to worry about
memory consumption.

Are there any further reading about this problem or configuration?

Support PostgreSQL to be embedded within an application to
limit the inter process comunication "overhead" to achive better
answer/respond results and limit the memory requirements of the
environment?

--
Raphael Bossek <raphael(dot)bossek(at)gmx(dot)de>


From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Raphael Bossek <raphael(dot)bossek(at)gmx(dot)de>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: PostgreSQL Lite for low-end/embedded systems (16MB of total memory)
Date: 2002-06-30 15:59:57
Message-ID: 20289.1025452797@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-general

Raphael Bossek <raphael(dot)bossek(at)gmx(dot)de> writes:
> do someone address the possibility to get the PostgreSQL
> working on systems or environments where the total memory
> does not exceed 16MB?

Define your terms, please. Is that 16M of RAM, or disk space?
How much of it is actually available for Postgres, as opposed
to other stuff? What is the OS (ie, do you have a porting problem
as well as a space problem)?

16M of RAM does not seem like much of a problem to me, as long as
you're envisioning a light-duty system (never more than a couple
concurrent backends, no need for lots of disk buffering). With
the default parameter settings Postgres probably doesn't need more
than 8M of RAM. (But this assumes Unix-like handling of memory,
in particular sharing of text pages between postmaster and its
child processes.)

But if you are talking 16M of disk then I think you are looking
at the wrong system. Indeed I wonder why you think you need a
database at all. If you only have a few meg of data to manage
then you hardly need SQL --- flat files searched with, say, grep
will do just fine.

> Support PostgreSQL to be embedded within an application to
> limit the inter process comunication "overhead" to achive better
> answer/respond results and limit the memory requirements of the
> environment?

Nope, and I don't think it's a good idea either. Any sort of
client-side programming error could destroy your database.

Perhaps you would be better off looking at Berkeley DB, which
is an open-source database library that seems more in line with
what you want to do.

regards, tom lane


From: Raphael Bossek <raphael(dot)bossek(at)gmx(dot)de>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: PostgreSQL Lite for low-end/embedded systems (16MB of total memory)
Date: 2002-06-30 16:12:02
Message-ID: 20020630161202.GA16261@mars
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-general

> Define your terms, please. Is that 16M of RAM, or disk space?
RAM. 16MB for disk space would be a overkill for PostgreSQL I
think, you too :)

> How much of it is actually available for Postgres, as opposed
> to other stuff?
5MB of RAM

> What is the OS (ie, do you have a porting problem as well as a
> space problem)?
Linux 2.4.3 (libc 2.2.5) for PowerPC

> With the default parameter settings Postgres probably doesn't need more
> than 8M of RAM.
This is true. A simple `ps` shows this values :)

My intention is to optimize this values as mutch as possible. For
our application we need user friedly respond times and swapping showed
us in the past that it can lead to unacceptable results so I try to
optimize everything could be optimized in RAM usage. New requirements
in the product lead us to look for a database so PostgreSQL could be
a solution for our further comming problems while reinventing the wheel.

So can PostgreSQL be "tuned" in this direction and where to start?

--
Raphael Bossek <raphael(dot)bossek(at)gmx(dot)de>


From: Steve Atkins <steve(at)blighty(dot)com>
To: pgsql-general(at)postgresql(dot)org
Subject: Re: PostgreSQL Lite for low-end/embedded systems (16MB of total memory)
Date: 2002-06-30 16:33:43
Message-ID: 20020630093343.A80486@blighty.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-general

On Sun, Jun 30, 2002 at 12:51:40PM +0200, Raphael Bossek wrote:

> do someone address the possibility to get the PostgreSQL
> working on systems or environments where the total memory
> does not exceed 16MB?

You probably could, but it would be overkill for a single user
environment, and painfully small for multiuser.

> We intent to use PostgreSQL for our next product because it
> offer the possibilities we are looking for but we need not
> all of them, e.g. networking, extensibility or stand-alone
> server capabilities are some of the features which are not
> of interest for this project. Instead we have to worry about
> memory consumption.
>
> Are there any further reading about this problem or configuration?
>
> Support PostgreSQL to be embedded within an application to
> limit the inter process comunication "overhead" to achive better
> answer/respond results and limit the memory requirements of the
> environment?

Ugly. You throw away many of the advantages of a separate database
server (multiuser access, primarily) and end up with an embedded
database that was never intended to be an embedded database - and that
after a lot of work and a lot of bugs.

Look at <http://www.hwaci.com/sw/sqlite/> if you need SQL or
<http://www.cql.com/>, <http://www.equi4.com/metakit>, or
possibly <http://www.sleepycat.com/>.

Check the licensing terms before investigating too far - while some of
them are freely available, some appear freely available at first glance
but have very high licensing costs for commercial use.

http://freshmeat.net/articles/view/305/ discusses a bunch of SQL
databases, including embedded ones. http://freshmeat.net/articles/view/307/
discusses some non-SQL embedded DBs.

Cheers,
Steve


From: "Mr(dot) Shannon Aldinger" <god(at)yinyang(dot)hjsoft(dot)com>
To: pgsql-general(at)postgresql(dot)org
Subject: pg_upgrade
Date: 2002-06-30 16:56:54
Message-ID: Pine.LNX.4.44.0206301252510.17715-100000@yinyang.hjsoft.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-general

Where does one find docs on the pg_upgrade tool, I've already used the
search pages on the website which returned nothing helpful. I already
looked at the man pages that came with 7.2.1 and there is no man page for
this tool.

So far all I've been able to get the tool to do is complain that it:
a. doesn't like the parameters and prints out the usage
b. that the file doesn't exist

Any pointers to documentation would be very appreciated.


From: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
To: god(at)yinyang(dot)hjsoft(dot)com
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: pg_upgrade
Date: 2002-06-30 17:14:58
Message-ID: 200206301714.g5UHEwt09167@candle.pha.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-general


Yes, grab the snapshot from our ftp server and use that. There was a
bug in the handling of the -D flag in 7.2.1. The only documentation is
the stuff in /contrib/pg_upgrade.

---------------------------------------------------------------------------

Mr. Shannon Aldinger wrote:
> Where does one find docs on the pg_upgrade tool, I've already used the
> search pages on the website which returned nothing helpful. I already
> looked at the man pages that came with 7.2.1 and there is no man page for
> this tool.
>
> So far all I've been able to get the tool to do is complain that it:
> a. doesn't like the parameters and prints out the usage
> b. that the file doesn't exist
>
> Any pointers to documentation would be very appreciated.
>
>
>
>
> ---------------------------(end of broadcast)---------------------------
> TIP 2: you can get off all lists at once with the unregister command
> (send "unregister YourEmailAddressHere" to majordomo(at)postgresql(dot)org)
>
>
>

--
Bruce Momjian | http://candle.pha.pa.us
pgman(at)candle(dot)pha(dot)pa(dot)us | (610) 853-3000
+ If your life is a hard drive, | 830 Blythe Avenue
+ Christ can be your backup. | Drexel Hill, Pennsylvania 19026


From: Raphael Bossek <raphael(dot)bossek(at)gmx(dot)de>
To: pgsql-general(at)postgresql(dot)org
Subject: Re: PostgreSQL Lite for low-end/embedded systems (16MB of total memory)
Date: 2002-06-30 18:22:08
Message-ID: 20020630182208.GA17830@mars
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-general

> Define your terms, please. Is that 16M of RAM, or disk space?
RAM. 16MB for disk space would be a overkill for PostgreSQL I
think, you too :)

> How much of it is actually available for Postgres, as opposed
> to other stuff?
5MB of RAM

> What is the OS (ie, do you have a porting problem as well as a
> space problem)?
Linux 2.4.3 (libc 2.2.5) for PowerPC

> With the default parameter settings Postgres probably doesn't need more
> than 8M of RAM.
This is true. A simple `ps` shows this values :)

My intention is to optimize this values as mutch as possible. For
our application we need user friedly respond times and swapping showed
us in the past that it can lead to unacceptable results so I try to
optimize everything could be optimized in RAM usage. New requirements
in the product lead us to look for a database so PostgreSQL could be
a solution for our further comming problems while reinventing the wheel.

So can PostgreSQL be "tuned" in this direction and where to start?

--
Raphael Bossek <raphael(dot)bossek(at)gmx(dot)de>