Received: from maia.hub.org (maia-2.hub.org [200.46.204.251]) by mail.postgresql.org (Postfix) with ESMTP id E672BB5DCC9 for ; Mon, 29 Aug 2011 12:46:13 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.251]) (amavisd-maia, port 10024) with ESMTP id 89761-02-5 for ; Mon, 29 Aug 2011 15:46:07 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mail-pz0-f42.google.com (mail-pz0-f42.google.com [209.85.210.42]) by mail.postgresql.org (Postfix) with ESMTP id C9C27B5DCE9 for ; Mon, 29 Aug 2011 12:46:01 -0300 (ADT) Received: by pzk37 with SMTP id 37so14597794pzk.15 for ; Mon, 29 Aug 2011 08:46:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=message-id:date:from:user-agent:mime-version:to:cc:subject :references:in-reply-to:content-type:content-transfer-encoding; bh=7LjhJrBwywiG+MUxsu+FBbd/wZ/xjpWy2hIt6+buFEo=; b=hm5VAOBcsWsLC30EkjzyNBhSxar4WDvtVLUSjB/u07+q2a/yjvNiwKcRL2AaQPok1u h88QLc24YNFxfv984rFhbsa3ZnvHvlJh9zeXsgQeWWIu8HwG6LQPZhZxT+KJYKoy54rA OvkgYpB8XBptan5mMXkPchxuz2tUkY/3jQJ6c= Received: by 10.142.158.3 with SMTP id g3mr2558076wfe.127.1314632760722; Mon, 29 Aug 2011 08:46:00 -0700 (PDT) Received: from [192.168.11.3] ([116.225.153.151]) by mx.google.com with ESMTPS id u2sm19124849pbq.9.2011.08.29.08.45.51 (version=TLSv1/SSLv3 cipher=OTHER); Mon, 29 Aug 2011 08:45:57 -0700 (PDT) Message-ID: <4E5BB423.6010303@gmail.com> Date: Mon, 29 Aug 2011 23:45:39 +0800 From: Rural Hunter User-Agent: Mozilla/5.0 (Windows NT 6.1; rv:6.0) Gecko/20110812 Thunderbird/6.0 MIME-Version: 1.0 To: Kevin Grittner CC: Julio Leyva , pgsql-admin@postgresql.org Subject: Re: plsql gets "out of memory" References: <4E5B8FF7.4040007@gmail.com> <4E5B9604.5070602@gmail.com> <4E5B518002000025000407E5@gw.wicourts.gov> <4E5BA3C0.7080909@gmail.com> <4E5B67910200002500040805@gw.wicourts.gov> In-Reply-To: <4E5B67910200002500040805@gw.wicourts.gov> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-1.899 tagged_above=-10 required=5 tests=BAYES_00=-1.9, FREEMAIL_FROM=0.001 X-Spam-Level: X-Archive-Number: 201108/228 X-Sequence-Number: 38215 Hi Kevin, Thank you very much for the quick and detailed answers/suggestions. I will check and try them. 于 2011/8/29 23:18, Kevin Grittner 写道: > Good (but don't forget to change that once the bulk load is done). You > should probably also turn off full_page_writes and synchronous_commit. > I've seen benchmarks which show that this helps, even with the other > settings you mention. I forgot to mention synchronous_commit is already off and I will test with full_page_writes off. >> Increase checkpoint_segments > > There can be paradoxical results with that. For reasons yet to be > determined, bulk conversion (unlike most workloads) sometimes runs > faster with a small setting like the default. You have to test to > see how it works in your environment. yes, will check that. > Yeah, you definitely want to build those only after the data for a > table is loaded. I also recommend a VACUUM FREEZE ANALYZE on the > database unless most of these rows will be deleted or updated before > you run a billion database transactions. Otherwise you will get a > painful "anti-wraparound" autovacuum on everything, probably at a time > of heavy usage. hmm....I will try to turn autovacuum off though I didn't see any resource intension caused by it. >> I have about 5G memory free on the server and have these memory >> settings: >> shared_buffers = 1GB >> work_mem = 8MB >> maintenance_work_mem = 1GB >> effective_cache_size = 4GB > > Reasonable for that amount of RAM, but that's seems like > underpowered hardware for the size of the database. If the > production conversion is going to be run against different hardware, > these tests may not be giving you very good numbers for what to > expect. I have mysql run on the server. The memory above is just for the import for pgsql. I will shutdown mysql and give the memory(32G totally) to pgsql when I doing the performance tests. > Network latency? Avoid encrypted connections for the load, and do > whatever you can to minimize latency, like attaching both machines to > the same switch. You can't improve performance much if you're working > on the things which are only using a small part of the time. > Identifying the source of your delays is the most important thing at > this point. No, I do the import locally on the db server so the network letency can be excluded.