Server instrumentation

Started by Andreas Pflugalmost 21 years ago4 messageshackers
Jump to latest
#1Andreas Pflug
pgadmin@pse-consulting.de

This post includes "dbsize backend integration" and "Server
instrumentation: pg_terminate_backend, pg_reload_conf"

Server instrumentation functions included:

pg_tablespace_size()
pg_database_size()
pg_relation_size()
pg_size_pretty()
well-known from contrib/dbsize, waiting in unapplied patches
http://candle.pha.pa.us/mhonarc/patches/msg00002.html

The rest is superuser only:

pg_terminate_backend()
exposing kill -SIGTERM <backendpid> to the client
pg_reload_conf()
SIGHUP to reload configuration files

pg_logfile_rotate()
Logfile rotation
pg_logdir_ls() and view pg_logdir_ls
lists all available log files in the log directory.

As posted in the initial version of the logger subprocess from July 2004.

pg_file_stat()
pg_file_length()
pg_file_read()
pg_file_write()
pg_file_unlink()
pg_file_rename()
pg_dir_ls()
generic file functions to access files in logdir and cluster dir.
These functions where implemented as initiated by Bruce, and discussed
intensively in
http://archives.postgresql.org/pgsql-patches/2004-07/msg00287.php

All functions are fully documented.
Additionally, documentation for pg_postmaster_start_time is included,
the code itself ist posted by Matthias Schmidt
http://candle.pha.pa.us/mhonarc/patches/msg00008.html

Regards,
Andreas

Attachments:

dbsize.ctext/x-csrc; name=dbsize.cDownload
genfile.ctext/x-csrc; name=genfile.cDownload
instrumentation.patchtext/x-patch; name=instrumentation.patchDownload+562-14
#2Tom Lane
tgl@sss.pgh.pa.us
In reply to: Andreas Pflug (#1)
Re: Server instrumentation

Andreas Pflug <pgadmin@pse-consulting.de> writes:

pg_terminate_backend()
exposing kill -SIGTERM <backendpid> to the client

The objections to this have not changed since last year; in fact they
are stronger because we have at least one report of actual trouble
with retail SIGTERMs.

pg_file_stat()
pg_file_length()
pg_file_read()
pg_file_write()
pg_file_unlink()
pg_file_rename()
pg_dir_ls()

I really have serious doubts about the value of this.

regards, tom lane

#3Andreas Pflug
pgadmin@pse-consulting.de
In reply to: Tom Lane (#2)
Re: Server instrumentation

Tom Lane wrote:

Andreas Pflug <pgadmin@pse-consulting.de> writes:

pg_terminate_backend()
exposing kill -SIGTERM <backendpid> to the client

The objections to this have not changed since last year; in fact they
are stronger because we have at least one report of actual trouble
with retail SIGTERMs.

I'm not arguing about that, still SIGTERMing a single backend is widely
used.

pg_file_stat()
pg_file_length()
pg_file_read()
pg_file_write()
pg_file_unlink()
pg_file_rename()
pg_dir_ls()

I really have serious doubts about the value of this.

You're insisting on this exceptionally weak argument for a year now. We
all know that you personally do everything from the cmd line, but there
*is* a requirement to have additional ways of access to config files. I
do have wide positive feedback on this, see the discussion a month back
(and some more private mails). And besides, they are already widely in
use by pgadmin from the win32 pgsql distro when displaying logfiles,
which is installed by default.

Regards,
Andreas

#4Andreas Pflug
pgadmin@pse-consulting.de
In reply to: Andreas Pflug (#1)
Re: Server instrumentation

- Updated to current cvs.
- pg_terminate_backend omitted
- contrib/dbsize cleaned to reflect move of functions to core

Attachments:

instrumentation.patchtext/x-patch; name=instrumentation.patchDownload+526-189
dbsize.ctext/x-csrc; name=dbsize.cDownload
genfile.ctext/x-csrc; name=genfile.cDownload