pg.ddx.io  pgsql-admin@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Andy Colson <andy@squeakycode.net>
To: contato@alexanderburbello.com.br
Cc: Alexander Burbello <burbello@yahoo.com.br>
Cc: pgsql-general@postgresql.org
Subject: Re: Restore db
Date: Sun, 13 Nov 2011 19:22:31 -0600
Message-ID: <4EC06D57.8020402@squeakycode.net> (raw)
In-Reply-To: <CAJcRiCWXaCnE34navMgDyT3pYVp=3XbAsp4fWjcvxFo78pFbWA@mail.gmail.com>
References: <CAJcRiCWXaCnE34navMgDyT3pYVp=3XbAsp4fWjcvxFo78pFbWA@mail.gmail.com>

On 11/13/2011 06:09 PM, Alexander Burbello wrote:
> Hi folks,
>
> My server has a daily routine to import a dump file, however its taking long time to finish it.
> The original db has around 200 MB and takes 3~4 minutes to export (there are many blob fields), however it takes 4 hours to import using pg_restore.
>
> What can I do to tune this database to speed up this restore??
>
> My current db parameters are:
> shared_buffers = 256MB
> maintenance_work_mem = 32MB
>
> Any suggestion is very welcome.
> Thank you.
> Alex

Are you doing this over a network?

If you watch it restore with vmstat (or top) are you IO bound?  If so, temporarily turn off fsync, restore the db, then turn it back on.

something like:
autovacuum = off
fsync = off
synchronous_commit = off
full_page_writes = off
bgwriter_lru_maxpages = 0


On the other hand, if you are cpu bound, use the multi-core-restore-option -j.

Or use both.

> My current db parameters are:
> shared_buffers = 256MB
> maintenance_work_mem = 32MB

This is useless information without knowing anything about your computer.  If you have 512 Meg of ram its a lot different than if you have 32 Gig.


-Andy
  



view thread (5+ messages)

Message-ID: <4EC06D57.8020402@squeakycode.net>
Permalink:  ../4EC06D57.8020402@squeakycode.net/
Also on:    postgresql.org/message-id/4EC06D57.8020402@squeakycode.net

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-admin@postgresql.org
  Cc: andy@squeakycode.net, contato@alexanderburbello.com.br, burbello@yahoo.com.br, pgsql-general@postgresql.org
  Subject: Re: Restore db
  In-Reply-To: <4EC06D57.8020402@squeakycode.net>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox