From: Theo Galanakis <Theo.Galanakis@lonelyplanet.com.au>
To: pgsql-sql@postgresql.org
Subject: Process priority.
Date: Fri, 18 Mar 2005 10:32:48 +1100
Message-ID: <D1444817B78AB546BF2896C2B70E7F04371F6D@ganesh.au.lpint.net> (raw)
Hi,
I wrote a C program that can be called through postgres via stored
procedures. It allows you to change the current postmaster process priority.
Essentially it's intended purpose would be to allow a highly
resource intensive postmaster process to run at a lower priority, allowing
other postmaster processes more cpu time. For example admin/reporting
backend sql's that impact the system. I guess this is the same as renice,
however it can be accessed programatically from the postgres box via any
client.
The three stored procs are as follows:
get_pid()
get_priority()
set_priority(int) <!--- setting a negative number(high priority)
requires root access, typical usage would be to set a lower priority, i.e.
of 20.
I would not use this as a alternative to setting up a replication
slave for reporting on a large production system.
I have attached the source code, it has already been compiled for
redhat Linux ES3. There is a README file to get you started. This was my
first attempt at writing a c function for postgres.
<<priority.rar>>
Theo Galanakis
Database Administrator
Lonely Planet Publications
90 Maribyrnong St, Footscray
Melbourne, Vic 3011
Australia
tel +61 3 8379 8000 ext 8395
fax + 61 3 8379 8111
theo_galanakis@lonelyplanet.com.au
<mailto:rowan.mckinnon@lonelyplanet.com.au>
______________________________________________________________________
This email, including attachments, is intended only for the addressee
and may be confidential, privileged and subject to copyright. If you
have received this email in error, please advise the sender and delete
it. If you are not the intended recipient of this email, you must not
use, copy or disclose its content to anyone. You must not copy or
communicate to others content that is confidential or subject to
copyright, unless you have the consent of the content owner.
Attachments:
priority.rar (application/octet-stream, 6.5K) download
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 from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-sql@postgresql.org
Cc: Theo.Galanakis@lonelyplanet.com.au
Subject: Re: Process priority.
In-Reply-To: <D1444817B78AB546BF2896C2B70E7F04371F6D@ganesh.au.lpint.net>
References: <D1444817B78AB546BF2896C2B70E7F04371F6D@ganesh.au.lpint.net>
* 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