Re: Memory use

Поиск
Список
Период
Сортировка
От HEARNE, TIMOTHY S
Тема Re: Memory use
Дата
Msg-id 00CF4A25E32E204B8968E067CE2BB0D90254A794@CAFRFD1MSGUSRJB.ITServices.sbc.com
обсуждение исходный текст
Ответ на Memory use  ("HEARNE, TIMOTHY S" <th1618@att.com>)
Ответы Re: Memory use  (Michael Rasmussen <michaelr@porch.com>)
Re: Memory use  (Fernando Hevia <fhevia@gmail.com>)
Список pgadmin-support

This is my second plea for assistance.  Can anyone assist me?  I have attempted to download a couple of different tools from the PostgreSQL site.  One would not compile on our server, pg_top-3.7.0, and another was targeted for PostgreSQL 9.3 and later.

If you have any questions, please feel free to contact me.

Tim Hearne
CAST Application DBA
Principal DBA

Centralized Development
AT&T Services, Inc.
e-mail:  timothy.hearne@att.com
http://intranet.att.com/its/cdtworx/content.cfm/home/

Agile Bronze Certified

AT&T CAST team mailbox:  g01494@att.com

PROPRIETARY INFORMATION
The Information contained herein is for use only by authorized employees of AT&T, and authorized

Affiliates of AT&T, and is not for general distribution within or outside the respective companies

 

From: pgadmin-support-owner@postgresql.org [mailto:pgadmin-support-owner@postgresql.org] On Behalf Of HEARNE, TIMOTHY S
Sent: Thursday, September 10, 2015 12:42 PM
To: pgadmin-support@postgresql.org
Cc: ANDERSON, RICHARD W; HIGGINS, BRIAN; Anil Kumar (a.kumar@castsoftware.com); WICKE, SCOTT W; Aditya Pai
Subject: [pgadmin-support] Memory use

 

***Security Advisory: This Message Originated Outside of AT&T ***
Reference http://cso.att.com/EmailSecurity/IDSP.html for more information.

I am attempting to determine the amount of memory which is being used by my 2 PostgreSQL instances (8.4.1 and 9.2.10).

OS Version:  Red Hat Enterprise Linux Server release 5.10 (Tikanga) (Linux xxxxxxx 2.6.18-371.11.1.el5 #1 SMP Mon Jun 30 04:51:39 EDT 2014 x86_64 x86_64 x86_64 GNU/Linux)

 

When I use top, I have recently observed memory usage of up to 190 GB but I am being told by our Server support team that it never uses more than about 12 GB of computational memory (including memory used by a small Oracle instance).  I have read on-line that because PostgreSQL uses shared memory that top (and pmap) tends to overstate the actual memory in use.

 

top - 09:47:30 up 330 days, 23:12,  1 user,  load average: 2.79, 3.37, 3.14

Tasks: 1525 total,   3 running, 1520 sleeping,   0 stopped,   2 zombie

Cpu(s):  3.0%us,  0.3%sy,  0.0%ni, 96.4%id,  0.4%wa,  0.0%hi,  0.0%si,  0.0%st

Mem:  264114472k total, 193001540k used, 71112932k free,   497484k buffers

Swap: 16779852k total,   697304k used, 16082548k free, 179534676k cached

 

Using the information found in Table 17-2. PostgreSQL Shared Memory Usage (http://www.postgresql.org/docs/9.2/interactive/kernel-resources.html), I have calculated the following for the instances:

 

8.4.1 instance:

Usage

Approximate shared memory bytes required (as of 8.3)

megs

Observed

Observed (megs)

Connections

(1800 + 270 * max_locks_per_transaction) * max_connections

                     332,316,000

               316.92

Autovacuum workers

(1800 + 270 * max_locks_per_transaction) * autovacuum_max_workers

                          3,323,160

                    3.17

Prepared transactions

(770 + 270 * max_locks_per_transaction) * max_prepared_transactions

                                         -  

                        -  

Shared disk buffers

(block_size + 208) * shared_buffers

         1,033,476,505,600

       985,600.00

       102,400.00

                      0.0977

WAL buffers

(wal_block_size + 8) * wal_buffers

                 16,777,216.00

                 16.00

           2,048.00

                      0.0020

Fixed space requirements

770 *1024

                             788,480

                    0.75

         1,033,494,071,296

       985,616.75

Variables

max_locks_per_transaction

4096

Max_connections

300

autovacuum_max_workers

3

max_prepared_transactions

0

0 means not used

block_size

1024

shared_buffers

838860800

wal_block_size

8192

wal_buffers

16777216

work_mem

16777216

 

 

9.2.10 instance:

Usage

Approximate shared memory bytes required (as of 8.3)

megs

Observed

Observed (megs)

Connections

(1800 + 270 * max_locks_per_transaction) * max_connections

                     332,316,000

               316.92

Autovacuum workers

(1800 + 270 * max_locks_per_transaction) * autovacuum_max_workers

                          3,323,160

                    3.17

Prepared transactions

(770 + 270 * max_locks_per_transaction) * max_prepared_transactions

                                         -  

                        -  

Shared disk buffers

(block_size + 208) * shared_buffers

         2,645,699,854,336

   2,523,136.00

       262,144.00

                      0.2500

WAL buffers

(wal_block_size + 8) * wal_buffers

                 16,777,216.00

                 16.00

           2,048.00

                      0.0020

Fixed space requirements

770 *1024

                             788,480

                    0.75

         2,645,717,420,032

   2,523,152.75

Variables

max_locks_per_transaction

4096

Max_connections

300

autovacuum_max_workers

3

max_prepared_transactions

0

0 means not used

block_size

1024

shared_buffers

2147483648

wal_block_size

8192

4.1015625

wal_buffers

16777216

work_mem

67108864

 

--------------------

The observed values above for Shared disk buffers and WAL Buffers were captured using the “Current Value” in the Backend Configuration Editor of the pgAdmin III (v1.18) tool.  They are a point in time value. 

 

I question the calculation for Shared disk buffers as it is way too high.  I saw another post stating the calculation could be off by the block size.  If that is the case, the displayed values above would be divided by 1024.  In the postgresql.conf files, the shared_buffer values were entered as 800MB and 2048MB.

 

The small Oracle mentioned above has the following SGA:

Fixed Size

           2,254,952

Variable Size

   1,392,510,872

Database Buffers

       704,643,072

Redo Buffers

         38,477,824

Bottom line, does it seem reasonable based upon the above that the server could only be using around 12 GB of memory?  Is there another way to determine the actual memory being used by the instances?

Thank you,

Tim Hearne

PROPRIETARY INFORMATION
The Information contained herein is for use only by authorized employees of AT&T, and authorized

Affiliates of AT&T, and is not for general distribution within or outside the respective companies

 

 

 

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

Предыдущее
От: Redoute
Дата:
Сообщение: Option Decimal mark not working?
Следующее
От: Michael Rasmussen
Дата:
Сообщение: Re: Memory use