Re: refusing connections based on load ...

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Neal Norwitz <neal(at)metaslash(dot)com>
Cc: The Hermit Hacker <scrappy(at)hub(dot)org>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: refusing connections based on load ...
Date: 2001-04-24 03:21:25
Message-ID: 25376.988082485@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

> Rather than do system('uptime') and incur the process start-up each time,
> you could do fp = popen('vmstat 60', 'r'), then just read the fp.

popen doesn't incur a process start? Get real. But you're right, popen()
is the right call not system(), because you need to read the stdout.

> I believe vmstat is fairly standard.

Not more so than uptime --- and the latter's output format is definitely
less variable across platforms. The HPUX man page goes so far as to say

WARNINGS
Users of vmstat must not rely on the exact field widths and spacing of
its output, as these will vary depending on the system, the release of
HP-UX, and the data to be displayed.

and that's just for *one* platform.

regards, tom lane

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Ian Lance Taylor 2001-04-24 03:24:51 Re: refusing connections based on load ...
Previous Message Neal Norwitz 2001-04-24 03:12:20 Re: refusing connections based on load ...