[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: [debian-knoppix] postgres database



> From Vincent Hermenier on Thursday, 2004-03-25 at 12:09:57 +0100:
>
> > I have remastered a knoppix that includes a postgres database.
> > 
> > On my first try, I've had problems due to the fact that the database was 
> > stored on a read-only medium, and that even if I actually didn't want to 
> > write in the database but just access it (this database will only be 
> > accessed).
> > 
> > So I have decided to store the data folder (/var/lib/postgres/data) as a 
> > tarball that is uncompressed during the booting sequence. As a consequence,
> > it is entirely stored in the ramdisk.
> > 
> > The problem is that the data folder I have is over 100Mo (even after having
> > done a reset of the xlogs). You can well imagine the problems I experiment 
> > on 
> > poor configurations :-)
> > 
> > I was wondering if you had any ideas on how to improve this.

Another idea would be the copy-on-write technique, ie. make the livecd think
it's writeable, and once changes need to be written store the files onto the
ramdisk. This way you wouldn't have to store everything in RAM: only the files
that need to be written in order to access the data would be.

There are a number of competiting ways (translucency, ovlfs,
LVM-overlaying) that lead to the same goal. Our project Morphix has gotten
reasonably far with the former (being able to apt-get install from the livecd,
run mysql databases), Slax uses the second and I believe Fabian and debix have
been experimenting with the third. (Before Fabian has to flame my pants off,
euh, comment: translucency
isn't much more than a dirty hack and LVM is the way to go ;-)

Now this should work if postgres stores it's data in multiple files and doesn't
have to write to any larger files. If not, it's effects would be the same as
when you store the postgres directory directly on a ramdisk. I'm not sure how
postgres physically stores it's data, the above does work with mysql, but
that's not very surprising considering how it 'works' :-)

Another way would be mount --binding the /var/lib/postgres directory from the
ramdisk. This way you wouldn't have to have to store your whole /var directory
in ramdisk, assuming you did do that on your first attempts. If you really have
100MB of files in /var/lib/postgres/data, it's going to get pretty messy...

Cheers, and happy hacking!

Alex de Landgraaf

PS. sorry for the plug :)

/------------------------------------------------------------------\
| Alex de Landgraaf            | The cure for boredom is curiosity |
| Student AI & CS, VU, A'dam   |  There is no cure for curiosity   |
| Phone: 06-16844084           |                                   |
| GPG: http://am.xs4all.nl/key_alex.asc         /'-'\              |
| www.alextreme.org & www.morphix.org          ( o o )             |
\------------------------------------------oOO0--(_)--0OOo---------/



_______________________________________________
debian-knoppix mailing list
debian-knoppix@linuxtag.org
http://mailman.linuxtag.org/mailman/listinfo/debian-knoppix


Reply to: