From: Jeff <threshar@torgo.978.org>
To: Alfranio Correia Junior <alfranio@lsd.di.uminho.pt>
Cc: pgsql-performance@postgresql.org
Subject: Re: Performance problems with a higher number of clients
Date: Thu, 11 Dec 2003 08:28:26 -0500
Message-ID: <20031211082826.7173d5e0.threshar@torgo.978.org> (raw)
In-Reply-To: <3FD7EEE8.4080904@lsd.di.uminho.pt>
References: <3FD7EEE8.4080904@lsd.di.uminho.pt>
On Thu, 11 Dec 2003 04:13:28 +0000
Alfranio Correia Junior <alfranio@lsd.di.uminho.pt> wrote:
> r b w swpd free buff cache si so bi bo in cs
> us sy id
> 2 29 1 106716 9576 7000 409876 32 154 5888 1262 616 1575
> 8 12 80
On linux I've found as soon as it has to swap its oh-so-wonderful VM
brings the machine to a screeching halt.
> sort_mem = 10240
>
Here's a big problem
This gives _EACH SORT_ 10MB (No more, no less) to play with.
10MB * 500 connections == 5000MB in one case.. Some queries may
have more sort steps. It is possible 1 connection could be using
30-40MB of sort_mem. You'll need to bring that value down to prevent
swapping.
If you have a few "common" queries that are run a lot check out hte
explain analyze. You can see about how much sort_mem you'll need. Look
in the sort step. it should tell you the width and the # of rows.
Multiply those. That is sort of how much memory you'll need (I'd round
it up a bit)
If under normal workload your DB is swapping you have problems. You'll
need to either tune your config or get bigger hardware. You may want to
also consider an OS that deals with that situation a bit better.
good luck.
--
Jeff Trout <jeff@jefftrout.com>
http://www.jefftrout.com/http://www.stuarthamm.net/
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-performance@postgresql.org
Cc: threshar@torgo.978.org, alfranio@lsd.di.uminho.pt
Subject: Re: Performance problems with a higher number of clients
In-Reply-To: <20031211082826.7173d5e0.threshar@torgo.978.org>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox