Received: from makus.postgresql.org (makus.postgresql.org [98.129.198.125]) by mail.postgresql.org (Postfix) with ESMTP id B48E85EC6B8 for ; Mon, 16 Jan 2012 05:25:56 -0400 (AST) Received: from mail-we0-f174.google.com ([74.125.82.174]) by makus.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1Rmip6-0007Mu-OG for pgsql-admin@postgresql.org; Mon, 16 Jan 2012 09:25:57 +0000 Received: by werb14 with SMTP id b14so121193wer.19 for ; Mon, 16 Jan 2012 01:25:39 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=message-id:date:from:user-agent:mime-version:to:subject :content-type:content-transfer-encoding; bh=9G7LrOTLjea6bPeQ3LfFnS3xAf5OQt30hfdflgdOhmo=; b=Qd0yJT85VAOsdyPeZcVTx6He9pSyJvTQFsG3c4jDHHqB4e8aQMWxZJ+CK50HJMvJz9 vSi1InVi59LZcUtm7tFwKBILs3vCIig6Ox/e+8Q4uyJxC6wv71GLv+Eu2scWgdkzb3MK I6KY4KZlTvjiiJqgfUbvwtCs9rUrrmgFesbKc= Received: by 10.216.131.90 with SMTP id l68mr3254007wei.36.1326705939937; Mon, 16 Jan 2012 01:25:39 -0800 (PST) Received: from zeus.local (88-149-210-129.dynamic.ngi.it. [88.149.210.129]) by mx.google.com with ESMTPS id gf8sm21488570wbb.11.2012.01.16.01.25.38 (version=SSLv3 cipher=OTHER); Mon, 16 Jan 2012 01:25:39 -0800 (PST) Message-ID: <4F13ED11.6080001@gmail.com> Date: Mon, 16 Jan 2012 10:25:37 +0100 From: Alexander Fortin User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.7; rv:8.0) Gecko/20111105 Thunderbird/8.0 MIME-Version: 1.0 To: pgsql-admin@postgresql.org Subject: Interpreting pg_stat_replication values Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Pg-Spam-Score: -2.6 (--) X-Archive-Number: 201201/55 X-Sequence-Number: 38967 Hi folks, We've got to monitor replication status (and lag) of a few 9.1.2 replicas and I'm trying to use values in master's pg_stat_replication to do so. The documentation [1] on postgresql.org doesn't explains exactly the internals, especially what the *_location values means. What I'm doing right now is to convert replay_location from 64 bit hex to integer and trace the growing trend, and looking at that I think it's quite impossible to be a WAL filename because the growing rate is way too fast (average 100k per second, with spikes of 8G per second). Anyway, the whole idea is to check "distance" between the actual value for the master (still have to figure out where is that) and the replicas replay_location, and alert if that value is too high compared to our average trends. If you've got better ideas to spare, don't hesitate ;) Thanks for your time [1] http://www.postgresql.org/docs/9.1/static/monitoring-stats.html#MONITORING-STATS-VIEWS -- Alexander Fortin http://about.me/alexanderfortin/