Re: Postgres performance comments from a MySQL user

Поиск
Список
Период
Сортировка
От Dann Corbit
Тема Re: Postgres performance comments from a MySQL user
Дата
Msg-id D90A5A6C612A39408103E6ECDD77B8294CDD51@voyager.corporate.connx.com
обсуждение исходный текст
Ответ на Postgres performance comments from a MySQL user  ("Jay O'Connor" <joconnor@cybermesa.com>)
Ответы Re: Postgres performance comments from a MySQL user  ("Matthew Nuzum" <cobalt@bearfruit.org>)
Список pgsql-general
> -----Original Message-----
> From: Dann Corbit
> Sent: Wednesday, June 11, 2003 12:35 PM
> To: Tom Lane; Kaarel
> Cc: Justin Clift; Jay O'Connor; pgsql-general@postgresql.org
> Subject: Re: [GENERAL] Postgres performance comments from a
> MySQL user
>
>
> > -----Original Message-----
> > From: Tom Lane [mailto:tgl@sss.pgh.pa.us]
> > Sent: Wednesday, June 11, 2003 12:28 PM
> > To: Kaarel
> > Cc: Justin Clift; Jay O'Connor; pgsql-general@postgresql.org
> > Subject: Re: [GENERAL] Postgres performance comments from a
> > MySQL user
> >
> >
> > Kaarel <kaarel@future.ee> writes:
> > > This makes me wonder why is the default configuration so
> > conservative?
> >
> > There are still a lot of platforms where desirable settings
> > will cause the database to fail to start, because the default
> > kernel limits on shared memory are still set for
> > 1980s-vintage hardware.
> >
> > We have had a policy for a long time that we'd rather the
> > out-of-the-box settings be guaranteed to start than that they
> > be optimal for performance.  No one is going to get as far as
> > testing performance if the system won't start for them.
> >
> > Having said that, though, I do wonder whether we couldn't
> > bump them up a little.  Are there still any live platforms
> > where the default SHMMAX is less than 4 MB?  (There was
> > discussion of this a month or two back on pghackers, but no
> > conclusion.)
>
> I think this would be very, very nice:
> Config_tool.exe runs, and examines:
> Operating system, available memory, disk, cpu speed, etc.
> (whatever it can figure out). Then it makes good guesses for
> what PostgreSQL parameters to use and reconfigures PostgreSQL.
>
> If it was part of the installation, then even better.

/*
Sample for Win32 machines.  It should be a snap for some UNIX guru to
write one for UNIX type systems.
*/


#include <windows.h>
#include <stdio.h>
// Use to change the divisor from Kb to Mb.

#define DIV 1024
// #define DIV 1

char           *divisor = "K";
// char *divisor = "";

// Handle the width of the field in which to print numbers this way to
// make changes easier. The asterisk in the print format specifier
// "%*ld" takes an int from the argument list, and uses it to pad and
// right-justify the number being formatted.
#define WIDTH 7

int             main(int argc, char *argv[])
{
    MEMORYSTATUS    stat;

    GlobalMemoryStatus(&stat);

    printf("%ld percent of memory is in use.\n",
           stat.dwMemoryLoad);
    printf("There are %*ld total %sbytes of physical memory.\n",
           WIDTH, stat.dwTotalPhys / DIV, divisor);
    printf("There are %*ld free %sbytes of physical memory.\n",
           WIDTH, stat.dwAvailPhys / DIV, divisor);
    printf("There are %*ld total %sbytes of paging file.\n",
           WIDTH, stat.dwTotalPageFile / DIV, divisor);
    printf("There are %*ld free %sbytes of paging file.\n",
           WIDTH, stat.dwAvailPageFile / DIV, divisor);
    printf("There are %*lx total %sbytes of virtual memory.\n",
           WIDTH, stat.dwTotalVirtual / DIV, divisor);
    printf("There are %*lx free %sbytes of virtual memory.\n",
           WIDTH, stat.dwAvailVirtual / DIV, divisor);
    return 0;
}
/*
C:\tmp>ramsize
74 percent of memory is in use.
There are  523744 total Kbytes of physical memory.
There are  131796 free Kbytes of physical memory.
There are 1539616 total Kbytes of paging file.
There are  646924 free Kbytes of paging file.
There are  1fff80 total Kbytes of virtual memory.
There are  1feb54 free Kbytes of virtual memory.
*/

В списке pgsql-general по дате отправления:

Предыдущее
От:
Дата:
Сообщение: Re: Pg_dumpall
Следующее
От: Oleg Bartunov
Дата:
Сообщение: Re: tsearch v2