Re: Determining server load

Поиск
Список
Период
Сортировка
От Israel Brewster
Тема Re: Determining server load
Дата
Msg-id 25078C77-7444-466A-92BD-65B5136FA4C5@ravnalaska.net
обсуждение исходный текст
Ответ на Re: Determining server load  (Jonathan Vanasco <postgres@2xlp.com>)
Список pgsql-general
On Sep 27, 2016, at 10:55 AM, Jonathan Vanasco <postgres@2xlp.com> wrote:


On Sep 27, 2016, at 2:46 PM, Israel Brewster wrote:

I do have those on, and I could write a parser that scans through the logs counting connections and disconnections to give a number of current connections at any given time. Trying to make it operate "in real time" would be interesting, though, as PG logs into different files by day-of-the-week (at least, with the settings I have), rather than into a single file that gets rotated out. I was kind of hoping such a tool, such as pgbadger (which, unfortunately, only seems to track connections per second and not consecutive connections), already existed, or that there was some way to have the database itself track this metric. If not, well, I guess that's another project :)

There are a lot of postgres configs and server specific tools... but on the application side and for general debugging, have you looked at statsd ?  https://github.com/etsy/statsd

it's a lightweight node.js app that runs on your server and listens for UDP signals, which your apps can emit for counting or timing.  We have a ton of Python apps logging to it, including every postgres connection open/close and error.  The overhead of clients and server is negligible.  When combined with the graphite app for browsing data via charts, it becomes really useful at detecting issues with load or errors stemming from a deployment  -- you just look for spikes and cliffs.  We even use it to log the volume of INSERTS vs SELECTS vs UPDATES being sent to postgres.

The more services/apps you run, the more useful it gets, as you can figure out which apps/deployments are screwing up postgres and the exact moment things went wrong.


That sounds quite promising. I'll look into it. Thanks!


-----------------------------------------------
Israel Brewster
Systems Analyst II
Ravn Alaska
5245 Airport Industrial Rd
Fairbanks, AK 99709
(907) 450-7293
-----------------------------------------------

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

Предыдущее
От: Israel Brewster
Дата:
Сообщение: Re: Determining server load
Следующее
От: Melvin Davidson
Дата:
Сообщение: Re: Determining server load