Re: Postgres server crash

From: "Craig A(dot) James" <cjames(at)modgraph-usa(dot)com>
To: Bruno Wolff III <bruno(at)wolff(dot)to>, "Craig A(dot) James" <cjames(at)modgraph-usa(dot)com>, pgsql-performance(at)postgresql(dot)org, mstone+postgres(at)mathom(dot)us
Subject: Re: Postgres server crash
Date: 2006-11-20 06:42:07
Message-ID: 45614E3F.4080008@modgraph-usa.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-performance

We're getting off-topic for this group except that this is *why* we're plagued with this problem, so I'll make one more observation.

Bruno Wolff III wrote:
>> They would allocate
>> 100's of GB of swap space rather than taking the time to design proper data
>> structures. If the program crashed every week or two, no big deal -- just
>> run it again. Overallocating memory is a valuable technique for such
>> applications.
>
> I don't think the above applies generally. Programmers need to be aware of
> the working set of CPU bound apps. If the program is constantly paging,
> the performance is going to be abysmal.

You're doing planetary number crunching, so you allocate an (x,y,z) space with 10^6 points on every axis, or 10^18 points, for roughly 2^60 64-bit floating-point numbers, or 2^68 bytes. But your space is mostly empty (just like real space). Where there's a planet or star, you're actually using memory, everywhere else, the memory is never referenced. So you're using just an ordinary amount of memory, but you can access your planet's data by simply referencing a three-dimensional array in FORTRAN. Just allow infinite overcommit, let the OS do the rest, and it actually works. A lot of molecular modeling works this way too.

This is how these applications were/are actually written. I'm not defending the method, just point out that it's real and it's one of the reasons virtual swap was invented.

Craig

In response to

Browse pgsql-performance by date

  From Date Subject
Next Message Mattias Kregert 2006-11-20 22:36:06 Re: Postgres server crash
Previous Message Bruno Wolff III 2006-11-20 01:59:52 Re: Postgres server crash