SlideShare ist ein Scribd-Unternehmen logo
1 von 43
Downloaden Sie, um offline zu lesen
pg proctab
Accessing System Stats in PostgreSQL


           Mark Wong
      markwkm@postgresql.org

     PostgreSQL Conference East 2010


         March 25-28, 2010
Slides available on slideshare




   http://www.slideshare.net/markwkm
Agenda




     Brief review of what PostgreSQL stats are available
     How pg proctab may help
Review



  Some of the PostgreSQL system catalog tables:
         pg stat activity
         pg stat database
         pg stat all tables
         pg stat all indexes
         pg statio all tables
         pg statio all indexes
Example: pg stat activity


  SELECT datname, procpid, usename, current_query
  FROM pg_stat_activity
  WHERE current_query <> ’<IDLE>’;

  datname         dbt5
  procpid         3260
  usename         postgres
  current_query   SELECT * FROM TradeLookupFrame3(
                  ’2006-2-27 9:15:0’,43000050000,20,
                  ’2005-11-23 12:6:8’,’ENGAPRB’)


  ...
Example: pg stat database




  SELECT datname, numbackends, xact_commit, xact_rollback
  FROM pg_stat_database
  ORDER BY datname;

  datname         dbt5
  numbackends     11
  xact_commit     228458
  xact_rollback   320
Example: pg stat all tables



  SELECT seq_scan, idx_scan, n_tup_ins, n_tup_upd,
         n_tup_del
  FROM pg_stat_all_tables
  WHERE relname = ’customer’;

  seq_scan    10
  idx_scan    152795
  n_tup_ins   5000
  n_tup_upd   0
  n_tup_del   0
Example: pg statio all tables



  SELECT heap_blks_read, heap_blks_hit, idx_blks_read,
         idx_blks_hit
  FROM pg_statio_all_tables
  WHERE relname = ’customer’;

  heap_blks_read   26897
  heap_blks_hit    141581
  idx_blks_read    5577
  idx_blks_hit     328770
__      __
           / ~~~/  . o O ( Want more! )
    ,----(       oo     )
  /        __      __/
 /|            ( |(
^     /___ / |
    |__|    |__|-"
What about operating system statistics?




      I/O? — iostat
      Processor Utilization? — mpstat
      Per Process Statistics? — pidstat
      Other system activity? — sar
      and so on...
Introducing pg proctab




   pg proctab is a collection of four C stored functions:
       pg cputime
       pg loadavg
       pg memusage
       pg proctab
__      __
           / ~~~/  . o O ( Examples? )
    ,----(       oo     )
  /        __      __/
 /|            ( |(
^     /___ / |
    |__|    |__|-"
Some of the things pg proctab should help with




       Query operating system process table
       Query operating system statistics
            Processor time
            Load averages
            Memory usage
       Without escaping out to a shell!
       ...plus generate reports about timeslices
   Note: Following examples are from Linux based systems.
pg cputime() Example




  SELECT *
  FROM pg_cputime();

  user     31529387
  nice     76
  system   6865679
  idle     574707718
  iowait   1985455
pg cputime() Column Description




  From Linux kernel source code at
  Documentation/filesystems/proc.txt:
  user: normal processes executing in user mode
  nice: niced processes executing in user mode
  system: processes executing in kernel mode
  idle: processes twiddling thumbs
  iowait: waiting for I/O to complete
pg loadavg() Example




  SELECT *
  FROM pg_loadavg();

  load1      7.71
  load5      7.73
  load15     7.62
  last_pid   4623
pg loadavg() Column Description




  load1: load average of last minute
  load5: load average of last 5 minutes
  load15: load average of last 15 minutes
  last pid: last pid running
pg memusage() Example


  SELECT *
  FROM pg_memusage();

  memused      32793836
  memfree      157704
  memshared    0
  membuffers   94216
  memcached    31749292
  swapused     13960
  swapfree     3986216
  swapcached   1264
pg memusage() Column Description


  Paraphrased from Linux kernel source code at
  Documentation/filesystems/proc.txt:
  memused: Total physical RAM used
  memfree: Total physical RAM not used
  memshared: Not used, always 0. (For Solaris.)
  membuffers: Temporary storage for raw disk blocks
  memcached: In-memory cache for ïŹles read from disk
  swapused: Total swap space used
  swapfree: Memory evicted from RAM that is now temporary on
  disk
  swapcached: Memory that was swapped out, now swapped in but
  still in swap
pg proctab() Partial Column Description

   Everything from the operating system such as /proc/<pid>/stat,
   /proc/<pid>/io and /proc/<pid>/cmdline as well as data
   from PostgreSQL system catalog such as pg stat activity table
   are available but we’ll only cover some of the ïŹelds here:
   Informative:
         pid
         comm - ïŹlename of the executable
         fullcomm (/proc/<pid>/cmdline)
         uid
         username
   Processor:
         utime - user mode jiïŹƒes
         stime - kernel mode jiïŹƒes
   ...
pg proctab() Partial Column Description (cont.)

   Memory:
          vsize - virtual memory size
          rss - resident set memory size
   I/O:
          syscr - number of read I/O operations
          syscw - number of write I/O operations
          reads - number of bytes which this process really did cause to
          be fetched from the storage layer
          writes - number of bytes which this process really did cause to
          be sent from the storage layer
          cwrites - number of bytes which this process caused to not
          happen, by truncating pagecache
__      __
           / ~~~/  . o O ( More useful examples? )
    ,----(       oo     )
  /        __      __/
 /|            ( |(
^     /___ / |
    |__|    |__|-"
pg proctab() Example

  SELECT datname, procpid, processor, state, fullcomm
  FROM pg_stat_activity, pg_proctab()
  WHERE procpid = pid;

  datname     dbt5
  procpid     3260
  processor   6
  state       R
  fullcomm    postgres: postgres dbt5 207.173.203.228(48950)
              SELECT

  datname     dbt5
  procpid     3261
  processor   1
  state       R
  fullcomm    postgres: postgres dbt5 207.173.203.228(48953)
              SELECT
__      __     /                      
           / ~~~/  . o O | Measuring performance |
    ,----(       oo     )  | of a query.           |
  /        __      __/                          /
 /|            ( |(
^     /___ / |
    |__|    |__|-"


You can ïŹnd the following helper scripts in the pg proctab
contrib directory.
Create snapshot tables




   Create a set of tables to hold all of the information returned by
   these 4 stored functions. Also creates a table to timestamp when a
   snapshot of data is taken.

   psql -f create-ps_procstat-tables.sql
Identify yourself.




   dbt3=# SELECT *
   FROM pg_backend_pid();

    pg_backend_pid
   ----------------
             4590
   (1 row)
Take a snapshot before running the query



   dbt3=# i ps_procstat-snap.sql

   BEGIN

    ps_snap_stats
   ---------------
                1
   (1 row)

   COMMIT
Execute an SQL statement

   Don’t focus too much on the actual query, the idea is that is you
   want to collect statistics for a single query:
   SELECT   nation,
            o_year,
            Sum(amount) AS sum_profit
   FROM     (SELECT n_name                                                          AS nation,
                    Extract(YEAR FROM o_orderdate)                                  AS o_year,
                    l_extendedprice * (1 - l_discount) - ps_supplycost * l_quantity AS amount
             FROM   part,
                    supplier,
                    lineitem,
                    partsupp,
                    orders,
                    nation
             WHERE s_suppkey = l_suppkey
             AND ps_suppkey = l_suppkey
             AND ps_partkey = l_partkey
             AND p_partkey = l_partkey
             AND o_orderkey = l_orderkey
             AND s_nationkey = n_nationkey
             AND p_name LIKE ’%white%’) AS profit
   GROUP BY nation,
            o_year
   ORDER BY nation,
            o_year DESC;
Take a snapshot after running the query



   dbt3=# i ps_procstat-snap.sql

   BEGIN

    ps_snap_stats
   ---------------
                2
   (1 row)

   COMMIT
Calculate Processor Utilization

   $ ./ps-processor-utilization.sh [pid] [before] [after]


   $ ./ps-processor-utilization.sh 4590 1 2
   Processor Utilization = 1.00 %


   What the script does (partially) should be the same as top:

   SELECT stime, utime, stime + utime AS total,
          extract(epoch FROM time)
   FROM ps_snaps a, ps_procstat b
   WHERE pid = ${PID}
     AND a.snap = b.snap
     AND a.snap = ${SNAP1}
Calculate Disk Utilization


   $ ./ps-io-utilization.sh 4590 1 2
   Reads = 276981
   Writes = 63803
   Reads (Bytes) = 2164604928
   Writes (Bytes) = 508166144
   Cancelled (Bytes) = 36880384

   SELECT syscr, syscw, reads, writes, cwrites
   FROM ps_snaps a, ps_procstat b
   WHERE pid = ${PID}
     AND a.snap = b.snap
     AND a.snap = ${SNAP1}
__      __     /                
           / ~~~/  . o O | Creating Custom |
    ,----(       oo     )  | Reports!        |
  /        __      __/                    /
 /|            ( |(
^     /___ / |
    |__|    |__|-"


ps-report-pl
__      __     /                       
           / ~~~/  . o O | Warning! Too much data |
    ,----(       oo     )  | to fit on screen!       |
  /        __      __/                           /
 /|            ( |(
^     /___ / |
    |__|    |__|-"
Creating Reports: Section 1


   Database       : dbt5
   Snapshot Start : 2010-03-26 15:24:51.516226-07
   Snapshot End   : 2010-03-26 15:25:51.57661-07

   -------------------
   Database Statistics
   -------------------
   Commits     : 421
   Rollbacks   : 2
   Blocks Read : 13919368
   Blocks Hit : 7876506
Creating Reports: Section 2


   ================
   Table Statistics
   ================
   ------------------------------------------ -------- ------------ -------- ------------- --------- --------
   Schema.Relation                            Seq Scan Seq Tup Read Idx Scan Idx Tup Fetch N Tup Ins N Tup Up
   ------------------------------------------ -------- ------------ -------- ------------- --------- --------



   ...

   public.account_permission                        0            0        3             3         0
   public.address                                   0            0      488           732         0
   public.broker                                  169         8067      259           259         0        3
   public.cash_transaction                          0            0      952           928        37        7
   public.charge                                   39          585        0             0         0
   public.commission_rate                          60         9820       18            44         0
   public.company                                   2         5000     1496          1496         0
   public.company_competitor                        0            0       61           183         0
   public.customer                                  0            0      375           375         0
   public.customer_account                          0            0      690           968         0        3
   public.customer_taxrate                         20       200000       40            40         0
   public.daily_market                              0            0     4322          4962         0



   ...
Creating Reports: Section 2 - Falling oïŹ€ the right side...




       N Tup Upd
       N Tup Del
       Last Vacuum
       Last Autovacuum
       Last Analyze
       Last Autoanalyze
Creating Reports: Section 3


   ================
   Index Statistics
   ================
   --------------------------------------------------------------------- -------- ------------ -------------
   Schema.Relation.Index                                                 Idx Scan Idx Tup Read Idx Tup Fetch
   --------------------------------------------------------------------- -------- ------------ -------------



   ...

   public.account_permission.pk_account_permission                             3            3             3
   public.address.pk_address                                                 488          732           732
   public.broker.pk_broker                                                   259          259           259
   public.cash_transaction.pk_cash_transaction                               952          998           928
   public.charge.pk_charge                                                     0            0             0
   public.commission_rate.pk_commission_rate                                  18           44             0
   public.company.i_co_name                                                   14           14            14
   public.company.pk_company                                                1482         1482          1482
   public.company_competitor.pk_company_competitor                            61          183           183
   public.customer.i_c_tax_id                                                 27           27            27
   public.customer.pk_customer                                               348          348           348
   public.customer_account.i_ca_c_id                                         198          477           476



   ...
What else can we do with pg proctab?




   Enable pg top to monitor remote databases by providing access to
   the database system’s operating system process table.
pg top
__      __
           / ~~~/  . o O ( Thank you! )
    ,----(       oo     )
  /        __      __/
 /|            ( |(
^     /___ / |
    |__|    |__|-"
. . . the ïŹne print . . .




    Links:
        http://git.postgresql.org/gitweb?p=pg_proctab.git
        git clone
        git://git.postgresql.org/git/pg proctab.git
Acknowledgements



  Haley Jane Wakenshaw

              __      __
             / ~~~/ 
      ,----(       oo     )
    /        __      __/
   /|            ( |(
  ^     /___ / |
      |__|    |__|-"
License




   This work is licensed under a Creative Commons Attribution 3.0
   Unported License. To view a copy of this license, (a) visit
   http://creativecommons.org/licenses/by/3.0/us/; or, (b)
   send a letter to Creative Commons, 171 2nd Street, Suite 300, San
   Francisco, California, 94105, USA.

Weitere Àhnliche Inhalte

Was ist angesagt?

New Ways to Find Latency in Linux Using Tracing
New Ways to Find Latency in Linux Using TracingNew Ways to Find Latency in Linux Using Tracing
New Ways to Find Latency in Linux Using TracingScyllaDB
 
PostgreSQLć…±æœ‰ăƒă‚™ăƒƒăƒ•ă‚Ąăšé–ąé€Łăƒ„ăƒŒăƒ«
PostgreSQLć…±æœ‰ăƒă‚™ăƒƒăƒ•ă‚Ąăšé–ąé€Łăƒ„ăƒŒăƒ«PostgreSQLć…±æœ‰ăƒă‚™ăƒƒăƒ•ă‚Ąăšé–ąé€Łăƒ„ăƒŒăƒ«
PostgreSQLć…±æœ‰ăƒă‚™ăƒƒăƒ•ă‚Ąăšé–ąé€Łăƒ„ăƒŒăƒ«Masahiko Sawada
 
PostgreSQL Deep Internal
PostgreSQL Deep InternalPostgreSQL Deep Internal
PostgreSQL Deep InternalEXEM
 
PostgreSQL 14 ヱニタăƒȘăƒłă‚°æ–°æ©ŸèƒœçŽč介PostgreSQL ă‚«ăƒłăƒ•ă‚ĄăƒŹăƒłă‚č #24、2021/06/08
PostgreSQL 14 ヱニタăƒȘăƒłă‚°æ–°æ©ŸèƒœçŽč介PostgreSQL ă‚«ăƒłăƒ•ă‚ĄăƒŹăƒłă‚č #24、2021/06/08PostgreSQL 14 ヱニタăƒȘăƒłă‚°æ–°æ©ŸèƒœçŽč介PostgreSQL ă‚«ăƒłăƒ•ă‚ĄăƒŹăƒłă‚č #24、2021/06/08
PostgreSQL 14 ヱニタăƒȘăƒłă‚°æ–°æ©ŸèƒœçŽč介PostgreSQL ă‚«ăƒłăƒ•ă‚ĄăƒŹăƒłă‚č #24、2021/06/08NTT DATA Technology & Innovation
 
patroni-based citrus high availability environment deployment
patroni-based citrus high availability environment deploymentpatroni-based citrus high availability environment deployment
patroni-based citrus high availability environment deploymenthyeongchae lee
 
Mastering PostgreSQL Administration
Mastering PostgreSQL AdministrationMastering PostgreSQL Administration
Mastering PostgreSQL AdministrationEDB
 
Introduction VAUUM, Freezing, XID wraparound
Introduction VAUUM, Freezing, XID wraparoundIntroduction VAUUM, Freezing, XID wraparound
Introduction VAUUM, Freezing, XID wraparoundMasahiko Sawada
 
焝PostgreSQLレプăƒȘă‚±ăƒŒă‚·ăƒ§ăƒł10摹ćčŽïŒćŸčćș•çŽč介
焝PostgreSQLレプăƒȘă‚±ăƒŒă‚·ăƒ§ăƒł10摹ćčŽïŒćŸčćș•çŽč介焝PostgreSQLレプăƒȘă‚±ăƒŒă‚·ăƒ§ăƒł10摹ćčŽïŒćŸčćș•çŽč介
焝PostgreSQLレプăƒȘă‚±ăƒŒă‚·ăƒ§ăƒł10摹ćčŽïŒćŸčćș•çŽč介NTT DATA Technology & Innovation
 
あăȘăŸăźçŸ„ă‚‰ăȘいPostgreSQLç›ŁèŠ–ăźäž–ç•Œ
あăȘăŸăźçŸ„ă‚‰ăȘいPostgreSQLç›ŁèŠ–ăźäž–ç•Œă‚ăȘăŸăźçŸ„ă‚‰ăȘいPostgreSQLç›ŁèŠ–ăźäž–ç•Œ
あăȘăŸăźçŸ„ă‚‰ăȘいPostgreSQLç›ŁèŠ–ăźäž–ç•ŒYoshinori Nakanishi
 
PostgreSQL WAL for DBAs
PostgreSQL WAL for DBAs PostgreSQL WAL for DBAs
PostgreSQL WAL for DBAs PGConf APAC
 
LISA2019 Linux Systems Performance
LISA2019 Linux Systems PerformanceLISA2019 Linux Systems Performance
LISA2019 Linux Systems PerformanceBrendan Gregg
 
Postgresql database administration volume 1
Postgresql database administration volume 1Postgresql database administration volume 1
Postgresql database administration volume 1Federico Campoli
 
Deploying PostgreSQL on Kubernetes
Deploying PostgreSQL on KubernetesDeploying PostgreSQL on Kubernetes
Deploying PostgreSQL on KubernetesJimmy Angelakos
 
Blazing Performance with Flame Graphs
Blazing Performance with Flame GraphsBlazing Performance with Flame Graphs
Blazing Performance with Flame GraphsBrendan Gregg
 
ProxySQL on Kubernetes
ProxySQL on KubernetesProxySQL on Kubernetes
ProxySQL on KubernetesRenĂ© CannaĂČ
 
Memoizeăźä»•ç”„ăżïŒˆçŹŹ41曞PostgreSQLă‚ąăƒłă‚«ăƒłăƒ•ă‚ĄăƒŹăƒłă‚č@ă‚Șăƒłăƒ©ă‚€ăƒł ç™șèĄšèł‡æ–™ïŒ‰
Memoizeăźä»•ç”„ăżïŒˆçŹŹ41曞PostgreSQLă‚ąăƒłă‚«ăƒłăƒ•ă‚ĄăƒŹăƒłă‚č@ă‚Șăƒłăƒ©ă‚€ăƒł ç™șèĄšèł‡æ–™ïŒ‰Memoizeăźä»•ç”„ăżïŒˆçŹŹ41曞PostgreSQLă‚ąăƒłă‚«ăƒłăƒ•ă‚ĄăƒŹăƒłă‚č@ă‚Șăƒłăƒ©ă‚€ăƒł ç™șèĄšèł‡æ–™ïŒ‰
Memoizeăźä»•ç”„ăżïŒˆçŹŹ41曞PostgreSQLă‚ąăƒłă‚«ăƒłăƒ•ă‚ĄăƒŹăƒłă‚č@ă‚Șăƒłăƒ©ă‚€ăƒł ç™șèĄšèł‡æ–™ïŒ‰NTT DATA Technology & Innovation
 
Linux tuning to improve PostgreSQL performance
Linux tuning to improve PostgreSQL performanceLinux tuning to improve PostgreSQL performance
Linux tuning to improve PostgreSQL performancePostgreSQL-Consulting
 
How does PostgreSQL work with disks: a DBA's checklist in detail. PGConf.US 2015
How does PostgreSQL work with disks: a DBA's checklist in detail. PGConf.US 2015How does PostgreSQL work with disks: a DBA's checklist in detail. PGConf.US 2015
How does PostgreSQL work with disks: a DBA's checklist in detail. PGConf.US 2015PostgreSQL-Consulting
 
PostgreSQLă‚ąăƒŒă‚­ăƒ†ă‚ŻăƒăƒŁć…„é–€ïŒˆPostgreSQL Conference 2012
PostgreSQLă‚ąăƒŒă‚­ăƒ†ă‚ŻăƒăƒŁć…„é–€ïŒˆPostgreSQL Conference 2012PostgreSQLă‚ąăƒŒă‚­ăƒ†ă‚ŻăƒăƒŁć…„é–€ïŒˆPostgreSQL Conference 2012
PostgreSQLă‚ąăƒŒă‚­ăƒ†ă‚ŻăƒăƒŁć…„é–€ïŒˆPostgreSQL Conference 2012Uptime Technologies LLC (JP)
 

Was ist angesagt? (20)

New Ways to Find Latency in Linux Using Tracing
New Ways to Find Latency in Linux Using TracingNew Ways to Find Latency in Linux Using Tracing
New Ways to Find Latency in Linux Using Tracing
 
PostgreSQLć…±æœ‰ăƒă‚™ăƒƒăƒ•ă‚Ąăšé–ąé€Łăƒ„ăƒŒăƒ«
PostgreSQLć…±æœ‰ăƒă‚™ăƒƒăƒ•ă‚Ąăšé–ąé€Łăƒ„ăƒŒăƒ«PostgreSQLć…±æœ‰ăƒă‚™ăƒƒăƒ•ă‚Ąăšé–ąé€Łăƒ„ăƒŒăƒ«
PostgreSQLć…±æœ‰ăƒă‚™ăƒƒăƒ•ă‚Ąăšé–ąé€Łăƒ„ăƒŒăƒ«
 
PostgreSQL Deep Internal
PostgreSQL Deep InternalPostgreSQL Deep Internal
PostgreSQL Deep Internal
 
PostgreSQL 14 ヱニタăƒȘăƒłă‚°æ–°æ©ŸèƒœçŽč介PostgreSQL ă‚«ăƒłăƒ•ă‚ĄăƒŹăƒłă‚č #24、2021/06/08
PostgreSQL 14 ヱニタăƒȘăƒłă‚°æ–°æ©ŸèƒœçŽč介PostgreSQL ă‚«ăƒłăƒ•ă‚ĄăƒŹăƒłă‚č #24、2021/06/08PostgreSQL 14 ヱニタăƒȘăƒłă‚°æ–°æ©ŸèƒœçŽč介PostgreSQL ă‚«ăƒłăƒ•ă‚ĄăƒŹăƒłă‚č #24、2021/06/08
PostgreSQL 14 ヱニタăƒȘăƒłă‚°æ–°æ©ŸèƒœçŽč介PostgreSQL ă‚«ăƒłăƒ•ă‚ĄăƒŹăƒłă‚č #24、2021/06/08
 
patroni-based citrus high availability environment deployment
patroni-based citrus high availability environment deploymentpatroni-based citrus high availability environment deployment
patroni-based citrus high availability environment deployment
 
Mastering PostgreSQL Administration
Mastering PostgreSQL AdministrationMastering PostgreSQL Administration
Mastering PostgreSQL Administration
 
Introduction VAUUM, Freezing, XID wraparound
Introduction VAUUM, Freezing, XID wraparoundIntroduction VAUUM, Freezing, XID wraparound
Introduction VAUUM, Freezing, XID wraparound
 
焝PostgreSQLレプăƒȘă‚±ăƒŒă‚·ăƒ§ăƒł10摹ćčŽïŒćŸčćș•çŽč介
焝PostgreSQLレプăƒȘă‚±ăƒŒă‚·ăƒ§ăƒł10摹ćčŽïŒćŸčćș•çŽč介焝PostgreSQLレプăƒȘă‚±ăƒŒă‚·ăƒ§ăƒł10摹ćčŽïŒćŸčćș•çŽč介
焝PostgreSQLレプăƒȘă‚±ăƒŒă‚·ăƒ§ăƒł10摹ćčŽïŒćŸčćș•çŽč介
 
あăȘăŸăźçŸ„ă‚‰ăȘいPostgreSQLç›ŁèŠ–ăźäž–ç•Œ
あăȘăŸăźçŸ„ă‚‰ăȘいPostgreSQLç›ŁèŠ–ăźäž–ç•Œă‚ăȘăŸăźçŸ„ă‚‰ăȘいPostgreSQLç›ŁèŠ–ăźäž–ç•Œ
あăȘăŸăźçŸ„ă‚‰ăȘいPostgreSQLç›ŁèŠ–ăźäž–ç•Œ
 
PostgreSQL WAL for DBAs
PostgreSQL WAL for DBAs PostgreSQL WAL for DBAs
PostgreSQL WAL for DBAs
 
LISA2019 Linux Systems Performance
LISA2019 Linux Systems PerformanceLISA2019 Linux Systems Performance
LISA2019 Linux Systems Performance
 
Postgresql database administration volume 1
Postgresql database administration volume 1Postgresql database administration volume 1
Postgresql database administration volume 1
 
Deploying PostgreSQL on Kubernetes
Deploying PostgreSQL on KubernetesDeploying PostgreSQL on Kubernetes
Deploying PostgreSQL on Kubernetes
 
PostgreSQL replication
PostgreSQL replicationPostgreSQL replication
PostgreSQL replication
 
Blazing Performance with Flame Graphs
Blazing Performance with Flame GraphsBlazing Performance with Flame Graphs
Blazing Performance with Flame Graphs
 
ProxySQL on Kubernetes
ProxySQL on KubernetesProxySQL on Kubernetes
ProxySQL on Kubernetes
 
Memoizeăźä»•ç”„ăżïŒˆçŹŹ41曞PostgreSQLă‚ąăƒłă‚«ăƒłăƒ•ă‚ĄăƒŹăƒłă‚č@ă‚Șăƒłăƒ©ă‚€ăƒł ç™șèĄšèł‡æ–™ïŒ‰
Memoizeăźä»•ç”„ăżïŒˆçŹŹ41曞PostgreSQLă‚ąăƒłă‚«ăƒłăƒ•ă‚ĄăƒŹăƒłă‚č@ă‚Șăƒłăƒ©ă‚€ăƒł ç™șèĄšèł‡æ–™ïŒ‰Memoizeăźä»•ç”„ăżïŒˆçŹŹ41曞PostgreSQLă‚ąăƒłă‚«ăƒłăƒ•ă‚ĄăƒŹăƒłă‚č@ă‚Șăƒłăƒ©ă‚€ăƒł ç™șèĄšèł‡æ–™ïŒ‰
Memoizeăźä»•ç”„ăżïŒˆçŹŹ41曞PostgreSQLă‚ąăƒłă‚«ăƒłăƒ•ă‚ĄăƒŹăƒłă‚č@ă‚Șăƒłăƒ©ă‚€ăƒł ç™șèĄšèł‡æ–™ïŒ‰
 
Linux tuning to improve PostgreSQL performance
Linux tuning to improve PostgreSQL performanceLinux tuning to improve PostgreSQL performance
Linux tuning to improve PostgreSQL performance
 
How does PostgreSQL work with disks: a DBA's checklist in detail. PGConf.US 2015
How does PostgreSQL work with disks: a DBA's checklist in detail. PGConf.US 2015How does PostgreSQL work with disks: a DBA's checklist in detail. PGConf.US 2015
How does PostgreSQL work with disks: a DBA's checklist in detail. PGConf.US 2015
 
PostgreSQLă‚ąăƒŒă‚­ăƒ†ă‚ŻăƒăƒŁć…„é–€ïŒˆPostgreSQL Conference 2012
PostgreSQLă‚ąăƒŒă‚­ăƒ†ă‚ŻăƒăƒŁć…„é–€ïŒˆPostgreSQL Conference 2012PostgreSQLă‚ąăƒŒă‚­ăƒ†ă‚ŻăƒăƒŁć…„é–€ïŒˆPostgreSQL Conference 2012
PostgreSQLă‚ąăƒŒă‚­ăƒ†ă‚ŻăƒăƒŁć…„é–€ïŒˆPostgreSQL Conference 2012
 

Ähnlich wie pg_proctab: Accessing System Stats in PostgreSQL

pg_proctab: Accessing System Stats in PostgreSQL
pg_proctab: Accessing System Stats in PostgreSQLpg_proctab: Accessing System Stats in PostgreSQL
pg_proctab: Accessing System Stats in PostgreSQLMark Wong
 
What’s new in 9.6, by PostgreSQL contributor
What’s new in 9.6, by PostgreSQL contributorWhat’s new in 9.6, by PostgreSQL contributor
What’s new in 9.6, by PostgreSQL contributorMasahiko Sawada
 
Best Practices in Handling Performance Issues
Best Practices in Handling Performance IssuesBest Practices in Handling Performance Issues
Best Practices in Handling Performance IssuesOdoo
 
Oracle Basics and Architecture
Oracle Basics and ArchitectureOracle Basics and Architecture
Oracle Basics and ArchitectureSidney Chen
 
Debug generic process
Debug generic processDebug generic process
Debug generic processVipin Varghese
 
CONFidence 2015: DTrace + OSX = Fun - Andrzej Dyjak
CONFidence 2015: DTrace + OSX = Fun - Andrzej Dyjak   CONFidence 2015: DTrace + OSX = Fun - Andrzej Dyjak
CONFidence 2015: DTrace + OSX = Fun - Andrzej Dyjak PROIDEA
 
Linux Systems Performance 2016
Linux Systems Performance 2016Linux Systems Performance 2016
Linux Systems Performance 2016Brendan Gregg
 
PGDay.Amsterdam 2018 - Stefan Fercot - Save your data with pgBackRest
PGDay.Amsterdam 2018 - Stefan Fercot - Save your data with pgBackRestPGDay.Amsterdam 2018 - Stefan Fercot - Save your data with pgBackRest
PGDay.Amsterdam 2018 - Stefan Fercot - Save your data with pgBackRestPGDay.Amsterdam
 
Deep dive into PostgreSQL statistics.
Deep dive into PostgreSQL statistics.Deep dive into PostgreSQL statistics.
Deep dive into PostgreSQL statistics.Alexey Lesovsky
 
PostgreSQL 8.4 TriLUG 2009-11-12
PostgreSQL 8.4 TriLUG 2009-11-12PostgreSQL 8.4 TriLUG 2009-11-12
PostgreSQL 8.4 TriLUG 2009-11-12Andrew Dunstan
 
Peeking into the Black Hole Called PL/PGSQL - the New PL Profiler / Jan Wieck...
Peeking into the Black Hole Called PL/PGSQL - the New PL Profiler / Jan Wieck...Peeking into the Black Hole Called PL/PGSQL - the New PL Profiler / Jan Wieck...
Peeking into the Black Hole Called PL/PGSQL - the New PL Profiler / Jan Wieck...Ontico
 
PostgreSQL Portland Performance Practice Project - Database Test 2 Howto
PostgreSQL Portland Performance Practice Project - Database Test 2 HowtoPostgreSQL Portland Performance Practice Project - Database Test 2 Howto
PostgreSQL Portland Performance Practice Project - Database Test 2 HowtoMark Wong
 
Thomas+Niewel+ +Oracletuning
Thomas+Niewel+ +OracletuningThomas+Niewel+ +Oracletuning
Thomas+Niewel+ +Oracletuningafa reg
 
Deep dive into PostgreSQL internal statistics / АлДĐșсДĐč Đ›Đ”ŃĐŸĐČсĐșĐžĐč (PostgreSQL...
Deep dive into PostgreSQL internal statistics / АлДĐșсДĐč Đ›Đ”ŃĐŸĐČсĐșĐžĐč (PostgreSQL...Deep dive into PostgreSQL internal statistics / АлДĐșсДĐč Đ›Đ”ŃĐŸĐČсĐșĐžĐč (PostgreSQL...
Deep dive into PostgreSQL internal statistics / АлДĐșсДĐč Đ›Đ”ŃĐŸĐČсĐșĐžĐč (PostgreSQL...Ontico
 
Open Source Systems Performance
Open Source Systems PerformanceOpen Source Systems Performance
Open Source Systems PerformanceBrendan Gregg
 
Oracle to Postgres Migration - part 2
Oracle to Postgres Migration - part 2Oracle to Postgres Migration - part 2
Oracle to Postgres Migration - part 2PgTraining
 
Designing Tracing Tools
Designing Tracing ToolsDesigning Tracing Tools
Designing Tracing ToolsSysdig
 

Ähnlich wie pg_proctab: Accessing System Stats in PostgreSQL (20)

pg_proctab: Accessing System Stats in PostgreSQL
pg_proctab: Accessing System Stats in PostgreSQLpg_proctab: Accessing System Stats in PostgreSQL
pg_proctab: Accessing System Stats in PostgreSQL
 
What’s new in 9.6, by PostgreSQL contributor
What’s new in 9.6, by PostgreSQL contributorWhat’s new in 9.6, by PostgreSQL contributor
What’s new in 9.6, by PostgreSQL contributor
 
Best Practices in Handling Performance Issues
Best Practices in Handling Performance IssuesBest Practices in Handling Performance Issues
Best Practices in Handling Performance Issues
 
Oracle Basics and Architecture
Oracle Basics and ArchitectureOracle Basics and Architecture
Oracle Basics and Architecture
 
Debug generic process
Debug generic processDebug generic process
Debug generic process
 
CONFidence 2015: DTrace + OSX = Fun - Andrzej Dyjak
CONFidence 2015: DTrace + OSX = Fun - Andrzej Dyjak   CONFidence 2015: DTrace + OSX = Fun - Andrzej Dyjak
CONFidence 2015: DTrace + OSX = Fun - Andrzej Dyjak
 
Linux Systems Performance 2016
Linux Systems Performance 2016Linux Systems Performance 2016
Linux Systems Performance 2016
 
PGDay.Amsterdam 2018 - Stefan Fercot - Save your data with pgBackRest
PGDay.Amsterdam 2018 - Stefan Fercot - Save your data with pgBackRestPGDay.Amsterdam 2018 - Stefan Fercot - Save your data with pgBackRest
PGDay.Amsterdam 2018 - Stefan Fercot - Save your data with pgBackRest
 
Explain this!
Explain this!Explain this!
Explain this!
 
Deep dive into PostgreSQL statistics.
Deep dive into PostgreSQL statistics.Deep dive into PostgreSQL statistics.
Deep dive into PostgreSQL statistics.
 
PostgreSQL 8.4 TriLUG 2009-11-12
PostgreSQL 8.4 TriLUG 2009-11-12PostgreSQL 8.4 TriLUG 2009-11-12
PostgreSQL 8.4 TriLUG 2009-11-12
 
Peeking into the Black Hole Called PL/PGSQL - the New PL Profiler / Jan Wieck...
Peeking into the Black Hole Called PL/PGSQL - the New PL Profiler / Jan Wieck...Peeking into the Black Hole Called PL/PGSQL - the New PL Profiler / Jan Wieck...
Peeking into the Black Hole Called PL/PGSQL - the New PL Profiler / Jan Wieck...
 
PostgreSQL Portland Performance Practice Project - Database Test 2 Howto
PostgreSQL Portland Performance Practice Project - Database Test 2 HowtoPostgreSQL Portland Performance Practice Project - Database Test 2 Howto
PostgreSQL Portland Performance Practice Project - Database Test 2 Howto
 
Thomas+Niewel+ +Oracletuning
Thomas+Niewel+ +OracletuningThomas+Niewel+ +Oracletuning
Thomas+Niewel+ +Oracletuning
 
8.4 Upcoming Features
8.4 Upcoming Features 8.4 Upcoming Features
8.4 Upcoming Features
 
Deep dive into PostgreSQL internal statistics / АлДĐșсДĐč Đ›Đ”ŃĐŸĐČсĐșĐžĐč (PostgreSQL...
Deep dive into PostgreSQL internal statistics / АлДĐșсДĐč Đ›Đ”ŃĐŸĐČсĐșĐžĐč (PostgreSQL...Deep dive into PostgreSQL internal statistics / АлДĐșсДĐč Đ›Đ”ŃĐŸĐČсĐșĐžĐč (PostgreSQL...
Deep dive into PostgreSQL internal statistics / АлДĐșсДĐč Đ›Đ”ŃĐŸĐČсĐșĐžĐč (PostgreSQL...
 
Open Source Systems Performance
Open Source Systems PerformanceOpen Source Systems Performance
Open Source Systems Performance
 
Oracle to Postgres Migration - part 2
Oracle to Postgres Migration - part 2Oracle to Postgres Migration - part 2
Oracle to Postgres Migration - part 2
 
Designing Tracing Tools
Designing Tracing ToolsDesigning Tracing Tools
Designing Tracing Tools
 
SOFA Tutorial
SOFA TutorialSOFA Tutorial
SOFA Tutorial
 

Mehr von Mark Wong

OHAI, my name is Chelnik! PGCon 2014 Mockumentary
OHAI, my name is Chelnik! PGCon 2014 MockumentaryOHAI, my name is Chelnik! PGCon 2014 Mockumentary
OHAI, my name is Chelnik! PGCon 2014 MockumentaryMark Wong
 
OHAI, my name is Chelnik! Postgres Open 2013 Report
OHAI, my name is Chelnik! Postgres Open 2013 ReportOHAI, my name is Chelnik! Postgres Open 2013 Report
OHAI, my name is Chelnik! Postgres Open 2013 ReportMark Wong
 
collectd & PostgreSQL
collectd & PostgreSQLcollectd & PostgreSQL
collectd & PostgreSQLMark Wong
 
Android & PostgreSQL
Android & PostgreSQLAndroid & PostgreSQL
Android & PostgreSQLMark Wong
 
PGTop for Android: Things I learned making this app
PGTop for Android: Things I learned making this appPGTop for Android: Things I learned making this app
PGTop for Android: Things I learned making this appMark Wong
 
Introduction to PostgreSQL
Introduction to PostgreSQLIntroduction to PostgreSQL
Introduction to PostgreSQLMark Wong
 
Developing PGTop for Android
Developing PGTop for AndroidDeveloping PGTop for Android
Developing PGTop for AndroidMark Wong
 
Pg in-the-brazilian-armed-forces-presentation
Pg in-the-brazilian-armed-forces-presentationPg in-the-brazilian-armed-forces-presentation
Pg in-the-brazilian-armed-forces-presentationMark Wong
 
PostgreSQL Portland Performance Practice Project - Database Test 2 Tuning
PostgreSQL Portland Performance Practice Project - Database Test 2 TuningPostgreSQL Portland Performance Practice Project - Database Test 2 Tuning
PostgreSQL Portland Performance Practice Project - Database Test 2 TuningMark Wong
 
Filesystem Performance from a Database Perspective
Filesystem Performance from a Database PerspectiveFilesystem Performance from a Database Perspective
Filesystem Performance from a Database PerspectiveMark Wong
 
PostgreSQL Portland Performance Practice Project - Database Test 2 Filesystem...
PostgreSQL Portland Performance Practice Project - Database Test 2 Filesystem...PostgreSQL Portland Performance Practice Project - Database Test 2 Filesystem...
PostgreSQL Portland Performance Practice Project - Database Test 2 Filesystem...Mark Wong
 
PostgreSQL Portland Performance Practice Project - Database Test 2 Workload D...
PostgreSQL Portland Performance Practice Project - Database Test 2 Workload D...PostgreSQL Portland Performance Practice Project - Database Test 2 Workload D...
PostgreSQL Portland Performance Practice Project - Database Test 2 Workload D...Mark Wong
 
PostgreSQL Portland Performance Practice Project - Database Test 2 Background
PostgreSQL Portland Performance Practice Project - Database Test 2 BackgroundPostgreSQL Portland Performance Practice Project - Database Test 2 Background
PostgreSQL Portland Performance Practice Project - Database Test 2 BackgroundMark Wong
 
PostgreSQL Portland Performance Practice Project - Database Test 2 Series Ove...
PostgreSQL Portland Performance Practice Project - Database Test 2 Series Ove...PostgreSQL Portland Performance Practice Project - Database Test 2 Series Ove...
PostgreSQL Portland Performance Practice Project - Database Test 2 Series Ove...Mark Wong
 
pg_top is 'top' for PostgreSQL: pg_top + pg_proctab
pg_top is 'top' for PostgreSQL: pg_top + pg_proctabpg_top is 'top' for PostgreSQL: pg_top + pg_proctab
pg_top is 'top' for PostgreSQL: pg_top + pg_proctabMark Wong
 
Linux Filesystems, RAID, and more
Linux Filesystems, RAID, and moreLinux Filesystems, RAID, and more
Linux Filesystems, RAID, and moreMark Wong
 
pg_top is 'top' for PostgreSQL
pg_top is 'top' for PostgreSQLpg_top is 'top' for PostgreSQL
pg_top is 'top' for PostgreSQLMark Wong
 
What Is Going On?
What Is Going On?What Is Going On?
What Is Going On?Mark Wong
 

Mehr von Mark Wong (18)

OHAI, my name is Chelnik! PGCon 2014 Mockumentary
OHAI, my name is Chelnik! PGCon 2014 MockumentaryOHAI, my name is Chelnik! PGCon 2014 Mockumentary
OHAI, my name is Chelnik! PGCon 2014 Mockumentary
 
OHAI, my name is Chelnik! Postgres Open 2013 Report
OHAI, my name is Chelnik! Postgres Open 2013 ReportOHAI, my name is Chelnik! Postgres Open 2013 Report
OHAI, my name is Chelnik! Postgres Open 2013 Report
 
collectd & PostgreSQL
collectd & PostgreSQLcollectd & PostgreSQL
collectd & PostgreSQL
 
Android & PostgreSQL
Android & PostgreSQLAndroid & PostgreSQL
Android & PostgreSQL
 
PGTop for Android: Things I learned making this app
PGTop for Android: Things I learned making this appPGTop for Android: Things I learned making this app
PGTop for Android: Things I learned making this app
 
Introduction to PostgreSQL
Introduction to PostgreSQLIntroduction to PostgreSQL
Introduction to PostgreSQL
 
Developing PGTop for Android
Developing PGTop for AndroidDeveloping PGTop for Android
Developing PGTop for Android
 
Pg in-the-brazilian-armed-forces-presentation
Pg in-the-brazilian-armed-forces-presentationPg in-the-brazilian-armed-forces-presentation
Pg in-the-brazilian-armed-forces-presentation
 
PostgreSQL Portland Performance Practice Project - Database Test 2 Tuning
PostgreSQL Portland Performance Practice Project - Database Test 2 TuningPostgreSQL Portland Performance Practice Project - Database Test 2 Tuning
PostgreSQL Portland Performance Practice Project - Database Test 2 Tuning
 
Filesystem Performance from a Database Perspective
Filesystem Performance from a Database PerspectiveFilesystem Performance from a Database Perspective
Filesystem Performance from a Database Perspective
 
PostgreSQL Portland Performance Practice Project - Database Test 2 Filesystem...
PostgreSQL Portland Performance Practice Project - Database Test 2 Filesystem...PostgreSQL Portland Performance Practice Project - Database Test 2 Filesystem...
PostgreSQL Portland Performance Practice Project - Database Test 2 Filesystem...
 
PostgreSQL Portland Performance Practice Project - Database Test 2 Workload D...
PostgreSQL Portland Performance Practice Project - Database Test 2 Workload D...PostgreSQL Portland Performance Practice Project - Database Test 2 Workload D...
PostgreSQL Portland Performance Practice Project - Database Test 2 Workload D...
 
PostgreSQL Portland Performance Practice Project - Database Test 2 Background
PostgreSQL Portland Performance Practice Project - Database Test 2 BackgroundPostgreSQL Portland Performance Practice Project - Database Test 2 Background
PostgreSQL Portland Performance Practice Project - Database Test 2 Background
 
PostgreSQL Portland Performance Practice Project - Database Test 2 Series Ove...
PostgreSQL Portland Performance Practice Project - Database Test 2 Series Ove...PostgreSQL Portland Performance Practice Project - Database Test 2 Series Ove...
PostgreSQL Portland Performance Practice Project - Database Test 2 Series Ove...
 
pg_top is 'top' for PostgreSQL: pg_top + pg_proctab
pg_top is 'top' for PostgreSQL: pg_top + pg_proctabpg_top is 'top' for PostgreSQL: pg_top + pg_proctab
pg_top is 'top' for PostgreSQL: pg_top + pg_proctab
 
Linux Filesystems, RAID, and more
Linux Filesystems, RAID, and moreLinux Filesystems, RAID, and more
Linux Filesystems, RAID, and more
 
pg_top is 'top' for PostgreSQL
pg_top is 'top' for PostgreSQLpg_top is 'top' for PostgreSQL
pg_top is 'top' for PostgreSQL
 
What Is Going On?
What Is Going On?What Is Going On?
What Is Going On?
 

KĂŒrzlich hochgeladen

Understanding the FAA Part 107 License ..
Understanding the FAA Part 107 License ..Understanding the FAA Part 107 License ..
Understanding the FAA Part 107 License ..Christopher Logan Kennedy
 
Exploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with MilvusExploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with MilvusZilliz
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businesspanagenda
 
Introduction to Multilingual Retrieval Augmented Generation (RAG)
Introduction to Multilingual Retrieval Augmented Generation (RAG)Introduction to Multilingual Retrieval Augmented Generation (RAG)
Introduction to Multilingual Retrieval Augmented Generation (RAG)Zilliz
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobeapidays
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc
 
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...Orbitshub
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...apidays
 
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Victor Rentea
 
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...apidays
 
Elevate Developer Efficiency & build GenAI Application with Amazon Q​
Elevate Developer Efficiency & build GenAI Application with Amazon Q​Elevate Developer Efficiency & build GenAI Application with Amazon Q​
Elevate Developer Efficiency & build GenAI Application with Amazon Q​Bhuvaneswari Subramani
 
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 AmsterdamDEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 AmsterdamUiPathCommunity
 
WSO2's API Vision: Unifying Control, Empowering Developers
WSO2's API Vision: Unifying Control, Empowering DevelopersWSO2's API Vision: Unifying Control, Empowering Developers
WSO2's API Vision: Unifying Control, Empowering DevelopersWSO2
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...DianaGray10
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century educationjfdjdjcjdnsjd
 
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...apidays
 
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...Zilliz
 
DBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDropbox
 
Vector Search -An Introduction in Oracle Database 23ai.pptx
Vector Search -An Introduction in Oracle Database 23ai.pptxVector Search -An Introduction in Oracle Database 23ai.pptx
Vector Search -An Introduction in Oracle Database 23ai.pptxRemote DBA Services
 

KĂŒrzlich hochgeladen (20)

Understanding the FAA Part 107 License ..
Understanding the FAA Part 107 License ..Understanding the FAA Part 107 License ..
Understanding the FAA Part 107 License ..
 
Exploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with MilvusExploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with Milvus
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
 
Introduction to Multilingual Retrieval Augmented Generation (RAG)
Introduction to Multilingual Retrieval Augmented Generation (RAG)Introduction to Multilingual Retrieval Augmented Generation (RAG)
Introduction to Multilingual Retrieval Augmented Generation (RAG)
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
 
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...
 
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
 
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
 
Elevate Developer Efficiency & build GenAI Application with Amazon Q​
Elevate Developer Efficiency & build GenAI Application with Amazon Q​Elevate Developer Efficiency & build GenAI Application with Amazon Q​
Elevate Developer Efficiency & build GenAI Application with Amazon Q​
 
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 AmsterdamDEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
 
WSO2's API Vision: Unifying Control, Empowering Developers
WSO2's API Vision: Unifying Control, Empowering DevelopersWSO2's API Vision: Unifying Control, Empowering Developers
WSO2's API Vision: Unifying Control, Empowering Developers
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
 
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
 
DBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor Presentation
 
Vector Search -An Introduction in Oracle Database 23ai.pptx
Vector Search -An Introduction in Oracle Database 23ai.pptxVector Search -An Introduction in Oracle Database 23ai.pptx
Vector Search -An Introduction in Oracle Database 23ai.pptx
 

pg_proctab: Accessing System Stats in PostgreSQL

  • 1. pg proctab Accessing System Stats in PostgreSQL Mark Wong markwkm@postgresql.org PostgreSQL Conference East 2010 March 25-28, 2010
  • 2. Slides available on slideshare http://www.slideshare.net/markwkm
  • 3. Agenda Brief review of what PostgreSQL stats are available How pg proctab may help
  • 4. Review Some of the PostgreSQL system catalog tables: pg stat activity pg stat database pg stat all tables pg stat all indexes pg statio all tables pg statio all indexes
  • 5. Example: pg stat activity SELECT datname, procpid, usename, current_query FROM pg_stat_activity WHERE current_query <> ’<IDLE>’; datname dbt5 procpid 3260 usename postgres current_query SELECT * FROM TradeLookupFrame3( ’2006-2-27 9:15:0’,43000050000,20, ’2005-11-23 12:6:8’,’ENGAPRB’) ...
  • 6. Example: pg stat database SELECT datname, numbackends, xact_commit, xact_rollback FROM pg_stat_database ORDER BY datname; datname dbt5 numbackends 11 xact_commit 228458 xact_rollback 320
  • 7. Example: pg stat all tables SELECT seq_scan, idx_scan, n_tup_ins, n_tup_upd, n_tup_del FROM pg_stat_all_tables WHERE relname = ’customer’; seq_scan 10 idx_scan 152795 n_tup_ins 5000 n_tup_upd 0 n_tup_del 0
  • 8. Example: pg statio all tables SELECT heap_blks_read, heap_blks_hit, idx_blks_read, idx_blks_hit FROM pg_statio_all_tables WHERE relname = ’customer’; heap_blks_read 26897 heap_blks_hit 141581 idx_blks_read 5577 idx_blks_hit 328770
  • 9. __ __ / ~~~/ . o O ( Want more! ) ,----( oo ) / __ __/ /| ( |( ^ /___ / | |__| |__|-"
  • 10. What about operating system statistics? I/O? — iostat Processor Utilization? — mpstat Per Process Statistics? — pidstat Other system activity? — sar and so on...
  • 11. Introducing pg proctab pg proctab is a collection of four C stored functions: pg cputime pg loadavg pg memusage pg proctab
  • 12. __ __ / ~~~/ . o O ( Examples? ) ,----( oo ) / __ __/ /| ( |( ^ /___ / | |__| |__|-"
  • 13. Some of the things pg proctab should help with Query operating system process table Query operating system statistics Processor time Load averages Memory usage Without escaping out to a shell! ...plus generate reports about timeslices Note: Following examples are from Linux based systems.
  • 14. pg cputime() Example SELECT * FROM pg_cputime(); user 31529387 nice 76 system 6865679 idle 574707718 iowait 1985455
  • 15. pg cputime() Column Description From Linux kernel source code at Documentation/filesystems/proc.txt: user: normal processes executing in user mode nice: niced processes executing in user mode system: processes executing in kernel mode idle: processes twiddling thumbs iowait: waiting for I/O to complete
  • 16. pg loadavg() Example SELECT * FROM pg_loadavg(); load1 7.71 load5 7.73 load15 7.62 last_pid 4623
  • 17. pg loadavg() Column Description load1: load average of last minute load5: load average of last 5 minutes load15: load average of last 15 minutes last pid: last pid running
  • 18. pg memusage() Example SELECT * FROM pg_memusage(); memused 32793836 memfree 157704 memshared 0 membuffers 94216 memcached 31749292 swapused 13960 swapfree 3986216 swapcached 1264
  • 19. pg memusage() Column Description Paraphrased from Linux kernel source code at Documentation/filesystems/proc.txt: memused: Total physical RAM used memfree: Total physical RAM not used memshared: Not used, always 0. (For Solaris.) membuffers: Temporary storage for raw disk blocks memcached: In-memory cache for ïŹles read from disk swapused: Total swap space used swapfree: Memory evicted from RAM that is now temporary on disk swapcached: Memory that was swapped out, now swapped in but still in swap
  • 20. pg proctab() Partial Column Description Everything from the operating system such as /proc/<pid>/stat, /proc/<pid>/io and /proc/<pid>/cmdline as well as data from PostgreSQL system catalog such as pg stat activity table are available but we’ll only cover some of the ïŹelds here: Informative: pid comm - ïŹlename of the executable fullcomm (/proc/<pid>/cmdline) uid username Processor: utime - user mode jiïŹƒes stime - kernel mode jiïŹƒes ...
  • 21. pg proctab() Partial Column Description (cont.) Memory: vsize - virtual memory size rss - resident set memory size I/O: syscr - number of read I/O operations syscw - number of write I/O operations reads - number of bytes which this process really did cause to be fetched from the storage layer writes - number of bytes which this process really did cause to be sent from the storage layer cwrites - number of bytes which this process caused to not happen, by truncating pagecache
  • 22. __ __ / ~~~/ . o O ( More useful examples? ) ,----( oo ) / __ __/ /| ( |( ^ /___ / | |__| |__|-"
  • 23. pg proctab() Example SELECT datname, procpid, processor, state, fullcomm FROM pg_stat_activity, pg_proctab() WHERE procpid = pid; datname dbt5 procpid 3260 processor 6 state R fullcomm postgres: postgres dbt5 207.173.203.228(48950) SELECT datname dbt5 procpid 3261 processor 1 state R fullcomm postgres: postgres dbt5 207.173.203.228(48953) SELECT
  • 24. __ __ / / ~~~/ . o O | Measuring performance | ,----( oo ) | of a query. | / __ __/ / /| ( |( ^ /___ / | |__| |__|-" You can ïŹnd the following helper scripts in the pg proctab contrib directory.
  • 25. Create snapshot tables Create a set of tables to hold all of the information returned by these 4 stored functions. Also creates a table to timestamp when a snapshot of data is taken. psql -f create-ps_procstat-tables.sql
  • 26. Identify yourself. dbt3=# SELECT * FROM pg_backend_pid(); pg_backend_pid ---------------- 4590 (1 row)
  • 27. Take a snapshot before running the query dbt3=# i ps_procstat-snap.sql BEGIN ps_snap_stats --------------- 1 (1 row) COMMIT
  • 28. Execute an SQL statement Don’t focus too much on the actual query, the idea is that is you want to collect statistics for a single query: SELECT nation, o_year, Sum(amount) AS sum_profit FROM (SELECT n_name AS nation, Extract(YEAR FROM o_orderdate) AS o_year, l_extendedprice * (1 - l_discount) - ps_supplycost * l_quantity AS amount FROM part, supplier, lineitem, partsupp, orders, nation WHERE s_suppkey = l_suppkey AND ps_suppkey = l_suppkey AND ps_partkey = l_partkey AND p_partkey = l_partkey AND o_orderkey = l_orderkey AND s_nationkey = n_nationkey AND p_name LIKE ’%white%’) AS profit GROUP BY nation, o_year ORDER BY nation, o_year DESC;
  • 29. Take a snapshot after running the query dbt3=# i ps_procstat-snap.sql BEGIN ps_snap_stats --------------- 2 (1 row) COMMIT
  • 30. Calculate Processor Utilization $ ./ps-processor-utilization.sh [pid] [before] [after] $ ./ps-processor-utilization.sh 4590 1 2 Processor Utilization = 1.00 % What the script does (partially) should be the same as top: SELECT stime, utime, stime + utime AS total, extract(epoch FROM time) FROM ps_snaps a, ps_procstat b WHERE pid = ${PID} AND a.snap = b.snap AND a.snap = ${SNAP1}
  • 31. Calculate Disk Utilization $ ./ps-io-utilization.sh 4590 1 2 Reads = 276981 Writes = 63803 Reads (Bytes) = 2164604928 Writes (Bytes) = 508166144 Cancelled (Bytes) = 36880384 SELECT syscr, syscw, reads, writes, cwrites FROM ps_snaps a, ps_procstat b WHERE pid = ${PID} AND a.snap = b.snap AND a.snap = ${SNAP1}
  • 32. __ __ / / ~~~/ . o O | Creating Custom | ,----( oo ) | Reports! | / __ __/ / /| ( |( ^ /___ / | |__| |__|-" ps-report-pl
  • 33. __ __ / / ~~~/ . o O | Warning! Too much data | ,----( oo ) | to fit on screen! | / __ __/ / /| ( |( ^ /___ / | |__| |__|-"
  • 34. Creating Reports: Section 1 Database : dbt5 Snapshot Start : 2010-03-26 15:24:51.516226-07 Snapshot End : 2010-03-26 15:25:51.57661-07 ------------------- Database Statistics ------------------- Commits : 421 Rollbacks : 2 Blocks Read : 13919368 Blocks Hit : 7876506
  • 35. Creating Reports: Section 2 ================ Table Statistics ================ ------------------------------------------ -------- ------------ -------- ------------- --------- -------- Schema.Relation Seq Scan Seq Tup Read Idx Scan Idx Tup Fetch N Tup Ins N Tup Up ------------------------------------------ -------- ------------ -------- ------------- --------- -------- ... public.account_permission 0 0 3 3 0 public.address 0 0 488 732 0 public.broker 169 8067 259 259 0 3 public.cash_transaction 0 0 952 928 37 7 public.charge 39 585 0 0 0 public.commission_rate 60 9820 18 44 0 public.company 2 5000 1496 1496 0 public.company_competitor 0 0 61 183 0 public.customer 0 0 375 375 0 public.customer_account 0 0 690 968 0 3 public.customer_taxrate 20 200000 40 40 0 public.daily_market 0 0 4322 4962 0 ...
  • 36. Creating Reports: Section 2 - Falling oïŹ€ the right side... N Tup Upd N Tup Del Last Vacuum Last Autovacuum Last Analyze Last Autoanalyze
  • 37. Creating Reports: Section 3 ================ Index Statistics ================ --------------------------------------------------------------------- -------- ------------ ------------- Schema.Relation.Index Idx Scan Idx Tup Read Idx Tup Fetch --------------------------------------------------------------------- -------- ------------ ------------- ... public.account_permission.pk_account_permission 3 3 3 public.address.pk_address 488 732 732 public.broker.pk_broker 259 259 259 public.cash_transaction.pk_cash_transaction 952 998 928 public.charge.pk_charge 0 0 0 public.commission_rate.pk_commission_rate 18 44 0 public.company.i_co_name 14 14 14 public.company.pk_company 1482 1482 1482 public.company_competitor.pk_company_competitor 61 183 183 public.customer.i_c_tax_id 27 27 27 public.customer.pk_customer 348 348 348 public.customer_account.i_ca_c_id 198 477 476 ...
  • 38. What else can we do with pg proctab? Enable pg top to monitor remote databases by providing access to the database system’s operating system process table.
  • 40. __ __ / ~~~/ . o O ( Thank you! ) ,----( oo ) / __ __/ /| ( |( ^ /___ / | |__| |__|-"
  • 41. . . . the ïŹne print . . . Links: http://git.postgresql.org/gitweb?p=pg_proctab.git git clone git://git.postgresql.org/git/pg proctab.git
  • 42. Acknowledgements Haley Jane Wakenshaw __ __ / ~~~/ ,----( oo ) / __ __/ /| ( |( ^ /___ / | |__| |__|-"
  • 43. License This work is licensed under a Creative Commons Attribution 3.0 Unported License. To view a copy of this license, (a) visit http://creativecommons.org/licenses/by/3.0/us/; or, (b) send a letter to Creative Commons, 171 2nd Street, Suite 300, San Francisco, California, 94105, USA.