Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1VM17Z-0002HI-AL for pgsql-admin@arkaria.postgresql.org; Tue, 17 Sep 2013 19:39:37 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.80) (envelope-from ) id 1VM17Y-0003Rz-NP for pgsql-admin@arkaria.postgresql.org; Tue, 17 Sep 2013 19:39:36 +0000 Received: from makus.postgresql.org ([2001:4800:7903:4::125]) by malur.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1VM17X-0003Rs-7m for pgsql-admin@postgresql.org; Tue, 17 Sep 2013 19:39:35 +0000 Received: from internet06.ebureau.com ([65.127.24.25]) by makus.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1VM17P-0007bW-TY for pgsql-admin@postgresql.org; Tue, 17 Sep 2013 19:39:34 +0000 Received: from localhost (localhost [127.0.0.1]) by internet06.ebureau.com (Postfix) with ESMTP id 629093F19875; Tue, 17 Sep 2013 14:39:27 -0500 (CDT) X-Virus-Scanned: amavisd-new at ebureau.com Received: from internet06.ebureau.com ([127.0.0.1]) by localhost (internet06.ebureau.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id LX2K8XmWqrq0; Tue, 17 Sep 2013 14:39:27 -0500 (CDT) Received: from punch.office.ebureau.com (punch.office.ebureau.com [10.10.20.24]) by internet06.ebureau.com (Postfix) with ESMTPSA id 2D4C53F19859; Tue, 17 Sep 2013 14:39:27 -0500 (CDT) Content-Type: multipart/alternative; boundary="Apple-Mail=_EB179685-346B-4601-9C72-27449A6111F3" Mime-Version: 1.0 (Mac OS X Mail 6.5 \(1508\)) Subject: Re: Dumping a database that is not accepting commands? From: Natalie Wenz In-Reply-To: Date: Tue, 17 Sep 2013 14:38:33 -0500 Cc: bricklen , Kevin Grittner Message-Id: References: <1379421830.30619.YahooMailNeo@web162902.mail.bf1.yahoo.com> To: "pgsql-admin@postgresql.org" X-Mailer: Apple Mail (2.1508) X-Pg-Spam-Score: -2.6 (--) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-admin Precedence: bulk Sender: pgsql-admin-owner@postgresql.org --Apple-Mail=_EB179685-346B-4601-9C72-27449A6111F3 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=windows-1252 It occurs to me that asking for feedback on the tuning, I am asking = about two separate things: Was there anything in the tuning below that contributed to the database = getting into trouble? And is there anything I should change in that = tuning to make the single-user vacuum as fast as it can be for optimal = recovery time? > version | PostgreSQL 9.1.9 on = x86_64-unknown-freebsd9.1, compiled by gcc (GCC) 4.2.1 20070831 patched = [FreeBSD], 64-bit > autovacuum | on > autovacuum_analyze_scale_factor | 0.1 > autovacuum_freeze_max_age | 800000000 > autovacuum_max_workers | 3 > autovacuum_vacuum_cost_delay | 0 > autovacuum_vacuum_scale_factor | 0.1 > checkpoint_segments | 128 > effective_cache_size | 12GB > listen_addresses | * > log_autovacuum_min_duration | 10s > log_destination | stderr > log_filename | logfile-%A.log > log_line_prefix | %t:%u:%r:[%p]:=20 > log_rotation_age | 1d > log_rotation_size | 1GB > log_truncate_on_rotation | on > logging_collector | on > maintenance_work_mem | 10GB > max_connections | 500 > max_stack_depth | 2MB > random_page_cost | 1 > seq_page_cost | 1 > shared_buffers | 128MB > synchronous_commit | off > temp_buffers | 128MB > TimeZone | US/Central > vacuum_cost_limit | 500 > wal_buffers | 32MB > work_mem | 256MB >=20 > This is the tuning of the original database, anything changed from the = default settings. The machine it was running on had 48GB of memory. The = database was 36TB, with 2 tables taking up the bulk of that (about 14TB = each), and about 10 other tables and a few large indexes making up the = rest. Our typical usage pattern is mostly inserts, with a some hourly = summaries (which take maybe 5 minutes), some daily summaries (which take = about 20-40 minutes), and a couple of end of month queries that take = several hours. We have the same setup and tuning in production, which is = about the same size, with an additional end of month query that runs off = one of the 14TB tables, which can take 4-7 days.=20 >=20 As far as ideal tuning for the new database, running on 9.3, which will = eventually hold all the data from the sad, recovering original database = with the usage patterns described below, how is this for a starting = point? I tried to follow the basic guidelines in the High Performance = book, but sometimes I feel like I'm largely guessing. name | = current_setting =20= = ---------------------------------+----------------------------------------= ----------------------------------------------------------------------- version | PostgreSQL 9.3.0 on = x86_64-unknown-freebsd9.1, compiled by gcc (GCC) 4.2.1 20070831 patched = [FreeBSD], 64-bit autovacuum | on autovacuum_analyze_scale_factor | 0.1 autovacuum_freeze_max_age | 800000000 autovacuum_max_workers | 3 autovacuum_vacuum_cost_delay | 0 autovacuum_vacuum_scale_factor | 0.1 checkpoint_segments | 128 effective_cache_size | 12GB lc_collate | C lc_ctype | C listen_addresses | * log_autovacuum_min_duration | 1min log_destination | stderr log_filename | logfile-%A.log log_line_prefix | %t:%u:%r:[%p]:=20 log_min_duration_statement | 1min log_rotation_age | 1d log_rotation_size | 1GB log_truncate_on_rotation | on logging_collector | on maintenance_work_mem | 4GB max_connections | 500 max_stack_depth | 2MB random_page_cost | 1 seq_page_cost | 1 shared_buffers | 12GB synchronous_commit | off temp_buffers | 128MB TimeZone | US/Central vacuum_cost_limit | 500 wal_buffers | 16MB work_mem | 256MB --Apple-Mail=_EB179685-346B-4601-9C72-27449A6111F3 Content-Transfer-Encoding: quoted-printable Content-Type: text/html; charset=windows-1252 It = occurs to me that asking for feedback on the tuning, I am asking about = two separate things:

Was there anything in the tuning = below that contributed to the database getting into trouble? And is = there anything I should change in that tuning to make the single-user = vacuum as fast as it can be for optimal recovery = time?

 version             =             | PostgreSQL 9.1.9 on = x86_64-unknown-freebsd9.1, compiled by gcc (GCC) 4.2.1 20070831 patched = [FreeBSD], 64-bit
 autovacuum           =            | on
 autovacuum_analyze_scale_factor | = 0.1
 autovacuum_freeze_max_age       | = 800000000
 autovacuum_max_workers       =    | 3
 autovacuum_vacuum_cost_delay    | = 0
 autovacuum_vacuum_scale_factor  | = 0.1
 checkpoint_segments =             | 128
 effective_cache_size         =    | 12GB
 listen_addresses           =      | *
 log_autovacuum_min_duration     | = 10s
 log_destination   =               | = stderr
 log_line_prefix         =         | = %t:%u:%r:[%p]: 
 log_rotation_age         =        | 1d
 log_rotation_size         =       | 1GB
 log_truncate_on_rotation       =  | on
 logging_collector=               | = on
 maintenance_work_mem =            | 10GB
 max_connections         =         | 500
 max_stack_depth         =         | 2MB
 random_page_cost         =        | 1
 seq_page_cost           =         | 1
 shared_buffers     =              | = 128MB
 synchronous_commit =              | = off
 temp_buffers   =                  | = 128MB
 TimeZone   =                     =  | US/Central
 vacuum_cost_limit         =       | 500
 wal_buffers           =           | 32MB
 work_mem           =              | = 256MB

This is the tuning of the original = database, anything changed from the default settings. The machine it was = running on had 48GB of memory. The database was 36TB, with 2 tables = taking up the bulk of that (about 14TB each), and about 10 other tables = and a few large indexes making up the rest. Our typical usage pattern is = mostly inserts, with a some hourly summaries (which take maybe 5 = minutes), some daily summaries (which take about 20-40 minutes), and a = couple of end of month queries that take several hours. We have the same = setup and tuning in production, which is about the same size, with an = additional end of month query that runs off one of the 14TB tables, = which can take 4-7 days. 


As = far as ideal tuning for the new database, running on 9.3, which will = eventually hold all the data from the sad, recovering original database = with the usage patterns described below, how is this for a starting = point? I tried to follow the basic guidelines in the High Performance = book, but sometimes I feel like I'm largely = guessing.

  =             name       =         |             =                     =                current_setting =                     =                     =        
---------------------------------+-----------------------= --------------------------------------------------------------------------= --------------
 version =                     =     | PostgreSQL 9.3.0 on x86_64-unknown-freebsd9.1, compiled = by gcc (GCC) 4.2.1 20070831 patched [FreeBSD], = 64-bit
 autovacuum   =                    | = on
 autovacuum_analyze_scale_factor | = 0.1
 autovacuum_freeze_max_age       | = 800000000
 autovacuum_max_workers       =    | 3
 autovacuum_vacuum_cost_delay    | = 0
 autovacuum_vacuum_scale_factor  | = 0.1
 checkpoint_segments =             | 128
 effective_cache_size   =          | 12GB
 lc_collate           =            | C
 lc_ctype           =              | = C
 listen_addresses   =              | = *
 log_autovacuum_min_duration     | = 1min
 log_destination =                 | = stderr
 log_line_prefix         =         | = %t:%u:%r:[%p]: 
 log_min_duration_statement      | = 1min
 log_rotation_age =                | = 1d
 log_rotation_size =               | = 1GB
 log_truncate_on_rotation=        | on
 logging_collector         =       | on
 maintenance_work_mem         =    | 4GB
 max_connections         =         | 500
 max_stack_depth         =         | 2MB
 random_page_cost         =        | 1
 seq_page_cost           =         | 1
 shared_buffers     =              | = 12GB
 synchronous_commit =              | = off
 temp_buffers   =                  | = 128MB
 TimeZone   =                     =  | US/Central
 vacuum_cost_limit         =       | 500
 wal_buffers           =           | 16MB
 work_mem           =              | = 256MB



<= /div>

= --Apple-Mail=_EB179685-346B-4601-9C72-27449A6111F3--