Re: refusing connections based on load ...

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: refusing connections based on load ...
Дата
Msg-id 25376.988082485@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: refusing connections based on load ...  (The Hermit Hacker <scrappy@hub.org>)
Список 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
dependingon the system, the release of    HP-UX, and the data to be displayed.
 

and that's just for *one* platform.
        regards, tom lane


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

Предыдущее
От: Larry Rosenman
Дата:
Сообщение: Re: refusing connections based on load ...
Следующее
От: Ian Lance Taylor
Дата:
Сообщение: Re: refusing connections based on load ...