Re: CPU killer - Mailing list pgsql-general

From Steve Wolfe
Subject Re: CPU killer
Date
Msg-id 007001c0429b$2740dbe0$50824e40@iboats.com
Whole thread Raw
In response to CPU killer  ("Vilson farias" <vilson.farias@digitro.com.br>)
List pgsql-general
> >     I've been using Postgres in a Pentium 75Mhz, Linux RedHat 6.2, 32Mb.
> >
> >    Every big query I execute uses too much cpu (more than 90%).
> >
> >    I start postgres with these params: su -l postgres -c
> > '/usr/bin/postmaster -B 2048  -i -D "/home/postgres/data"' &.
> >
> > What should I do for avoid postgres extreme cpu allocation? I know
sometimes
> > non-indexed tables or huge size tables can be slow, but here I don't
care
> > about execution speed, I just want less cpu allocation no matter how
slow.

     First, there's a problem in how you're starting it up.  You're telling
Postgres (via the "-B 2048) to allocate 16 megabytes for shared memory
buffers - which leaves only 16 megs for your OS, the database, and every
other process on the system.  Large queries are probably filling that up,
forcing the machine to swap quite a bit.  Try dropping it to "-B 128" or "-b
256", and see if that makes a difference.  And, as was already stated, nice
or renice will help if you want to make sure that other processes get time
on the CPU - but if your query is causing heavy disk I/O on an IDE drive,
you can still expect system responsiveness to drop significantly.

steve




pgsql-general by date:

Previous
From: "G. Anthony Reina"
Date:
Subject: Listserver problems?
Next
From: James Hall
Date:
Subject: Postgres not finding tables