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

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

From
Raphael Bossek
Date:
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.bossek@gmx.de>



Raphael Bossek <raphael.bossek@gmx.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



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

From
Raphael Bossek
Date:
> 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.bossek@gmx.de>



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

From
Steve Atkins
Date:
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





pg_upgrade

From
"Mr. Shannon Aldinger"
Date:
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.




Re: pg_upgrade

From
Bruce Momjian
Date:
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@postgresql.org)
>
>
>

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



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

From
Raphael Bossek
Date:
> 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.bossek@gmx.de>