X-Original-To: pgsql-performance-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id 1F7E78B9F8B for ; Wed, 9 Feb 2005 14:49:37 +0000 (GMT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 02261-06 for ; Wed, 9 Feb 2005 14:49:19 +0000 (GMT) Received: from ct.radiology.uiowa.edu (ct.radiology.uiowa.edu [129.255.60.186]) by svr1.postgresql.org (Postfix) with ESMTP id 7A5128B9B45 for ; Wed, 9 Feb 2005 14:49:21 +0000 (GMT) Received: from [192.168.1.11] (12-217-241-0.client.mchsi.com [12.217.241.0]) by ct.radiology.uiowa.edu (8.11.6/8.11.6) with ESMTP id j19EnI308152; Wed, 9 Feb 2005 08:49:18 -0600 Message-ID: <420A22E7.5010501@arbash-meinel.com> Date: Wed, 09 Feb 2005 08:49:11 -0600 From: John A Meinel User-Agent: Mozilla Thunderbird 1.0 (Windows/20041206) X-Accept-Language: en-us, en MIME-Version: 1.0 To: Alex Cc: pgsql-performance@postgresql.org Subject: Re: How can I make use of both CPUs in a dual processor References: <420A1D9B.1040801@meerkatsoft.com> In-Reply-To: <420A1D9B.1040801@meerkatsoft.com> X-Enigmail-Version: 0.89.5.0 X-Enigmail-Supports: pgp-inline, pgp-mime Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="------------enig7F8F6929B0B4141D3353FB58" X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0 tagged_above=0 required=5 tests= X-Spam-Level: X-Archive-Number: 200502/137 X-Sequence-Number: 10466 This is an OpenPGP/MIME signed message (RFC 2440 and 3156) --------------enig7F8F6929B0B4141D3353FB58 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Alex wrote: > Hi, > we just got a new dual processor machine and I wonder if there is a > way to utilize both processors. > > Our DB server is basically fully dedicated to postgres. (its a dual > amd with 4gb mem.) > > I have a batch job that periodically loads about 8 million records > into a table. > for this I drop the indices, truncate the table, use the copy to > insert the data, recreate the indices (4 indices), vacuum the table. > > That is all done through a perl batch job. > > While I am doing this, I noticed that only one CPU is really used. > > So here are my questions: > > Is there a way to utilize both CPUs > For postgres, you get a max of 1 CPU per connection, so to use both, you need 2 CPU's. > Is it possible to split up the import file and run 2 copy processes > > Is it possible to create 2 indices at the same time > You'd want to be a little careful. Postgres uses work_mem for vacuum and index creation, so if you have 2 processes doing it, just make sure you aren't running out of RAM and going to swap. > Would I actually gain anything from that, or is the bottleneck > somewhere else ? > More likely, the bottleneck would be disk I/O. Simply because it is almost always disk I/O. However, without knowing your configuration, how much CPU is used during the operation, etc, it's hard to say. > (perl is a given here for the batch job) > > If anyone has some experience or ideas... any hints or help on this > would be appreciated. > > Thanks > Alex > Sorry I wasn't a lot of help. You should probably post your postgres version, and more information about how much CPU load there is while your load is running. John =:-> --------------enig7F8F6929B0B4141D3353FB58 Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.6 (Cygwin) Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org iD8DBQFCCiLqJdeBCYSNAAMRAs57AJ0WrL7te9DXyN7wOckjgZ9XUzHpmgCePB7R eRHtE0baqplSoTel8EU8WKI= =HcWm -----END PGP SIGNATURE----- --------------enig7F8F6929B0B4141D3353FB58--