Re: PostgreSQL Tweaking

From: "renier" <renier(at)vvconsult(dot)co(dot)za>
To: "'Alastair Turner'" <bell(at)ctrlf5(dot)co(dot)za>
Cc: <jnbpug(at)postgresql(dot)org>
Subject: Re: PostgreSQL Tweaking
Date: 2010-04-09 10:54:25
Message-ID: 72a1f9be-ba1c-4999-b61a-7195b44efd8d@vvconsult.co.za
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: jnbpug

OK, after running the Explain Analyse, the execution time jumped from +- 230000ms t0 +- 14000ms on the localhost.... can someone explain this? (pun intended... :)
Running it from my PC over the network, it constantly executes at about 48000ms, regardless of the server used (New Server, old desktop PC or Ubuntu Virtual server)

select * from assetregistericon

Explain Analyse results:
"Seq Scan on assetregistericon (cost=0.00..41106.50 rows=738050 width=428) (actual time=0.036..667.962 rows=738050 loops=1)"
"Total runtime: 1209.181 ms"

-- Executing query:

BEGIN;
EXPLAIN ANALYZE select * from assetregistericon
;
ROLLBACK;
Query result with 2 rows will be returned.

2 rows retrieved.

-- Executing query:
select * from assetregistericon
Total query runtime: 14420 ms.
738050 rows retrieved.

-- Executing query:

BEGIN;
EXPLAIN ANALYZE select * from assetregistericon
;
ROLLBACK;
Query result with 2 rows will be returned.

2 rows retrieved.

-- Executing query:
select * from assetregistericon
Total query runtime: 14910 ms.
738050 rows retrieved.

-- Executing query:
select * from assetregistericon
Total query runtime: 16345 ms.
738050 rows retrieved.

-----Original Message-----
From: jnbpug-owner(at)postgresql(dot)org [mailto:jnbpug-owner(at)postgresql(dot)org] On Behalf Of Alastair Turner
Sent: 09 April 2010 12:25 PM
To: renier
Cc: jnbpug(at)postgresql(dot)org
Subject: Re: [jnbpug] PostgreSQL Tweaking

Could you post your benchmark query and an EXPLAIN ANALYSE of it?

On Fri, Apr 9, 2010 at 12:13 PM, renier <renier(at)vvconsult(dot)co(dot)za> wrote:
> Thanks Bell. One of the users on the group already responded, conversation attached which will give some more details, maybe more users can benefit from this conversation
>
>
> -----------------Corrie reply---------------
> Hi Renier, you'll have to be bit more specific regarding the setup there?
>
> 1) What version of postgres?
> 2) What type of application will be using it? Website/intranet site/custom app ect?
> 3) How many connections are we talking here?
> 4) Maybe post your current config files to the web somewhere, where people can have a look?
>
> More information you can give, the easier people can help you guys?
>
> Corrie
>
>
> -----------------My reply---------------
>
> Hi Corrie.
>
> Thanks for the reply. I did not want to give too much info and bore the people that will not be interested to help. But now that you mention it, I will probably also have to send out all these details that I’m sending you, to all willing participants.
>
> We are running a PostgresPlus Standard Server, the latest stable 8.4 release with all updates. After the install (Whether we select Dedicated Server/Mixed) we need to replace the original config file as the service will not start up. I think it has to do with the amount of shared memory allocated.
> The server runs Windows Server 2008 x64. It will be mainly used for internal development (for now), and we also plan to set up a VM on the machine for hosting some ASP applications, mainly for demo purposes at clients, as it takes time to configure IIS on individual laptops all the time. We will probably never have more than 10 connections, say 20 to provide a bit for the future. We are only 4 developers that will use it on a day to day basis. The DB will mainly serve our own desktop applications. And then the occasional demo or 2 at a client.
>
> At the moment we are using the default config file as our tweaking does not seem to serve any purpose. Most of the time the service won’t even start (usually complaining about not having enough shared memory or something similar). Running our “benchmark query”, (735000 spatial records), the CPU does not go above 1 or 2 % usage, but the query takes 3 ½ minutes to complete on the localhost. Running it over the network, it runs in 48seconds, the same as on our dektop test pc. Kinda makes us wonder why we just forked out 100k for a server?
> This server also acts as a secondary domain controller, and we run VMWare on it (this will be for our Web environment). We could dedicate up to 16GB of RAM for postgres
>
> Thanks!
> Renier
>
> -----Original Message-----
> From: Alastair Turner [mailto:bell(at)ctrlf5(dot)co(dot)za]
> Sent: 09 April 2010 12:09 PM
> To: renier
> Cc: jnbpug(at)postgresql(dot)org
> Subject: Re: [jnbpug] PostgreSQL Tweaking
>
> On Fri, Apr 9, 2010 at 10:27 AM, renier <renier(at)vvconsult(dot)co(dot)za> wrote:
>> Hi There. Is there anyone in the SA PostgreSQL community that is willing to
>> assist us.
>>
>>
>>
>> We started trials on PostgreSQL just over a year ago, so we used on old
>> desktop lying around as our database server, which served fine for testing
>> purposes. We eventually bought a new server (2x2.93GHZ Quad core Xeon, 32GB
>> RAM, 6x450GB SAS 15000RPM drives etc), quite a decent machine, but the
>> performance on this machine is the same, if not worse, than it is on our old
>> “server”. We tried tweaking the postgres.conf file but we do not really
>> have enough knowledge of this file and performance does not increase, or the
>> service wont start.
>>
>>
>>
>> Is there anyone out there with enough experience in postgreSQL tweaking that
>> might be willing to assist in some db tuning, and help us learn?
>>
>> Regards,
>>
>> Renier
>>
>> __________ Information from ESET NOD32 Antivirus, version of virus signature
>> database 5012 (20100409) __________
>>
>> The message was checked by ESET NOD32 Antivirus.
>>
>> http://www.eset.com
>>
>
> Hi Renier
>
> Firstly, thanks for turning to the mailing list for assistance, it's
> great to be getting some traffic.
>
> You say that the server won't start after some of the config changes.
> If these are to the shared memory settings then you're going to have
> to tweak the kernel's shm_max and shm_all settings (assuming that this
> is on a Linux system). The doc at
> http://www.postgresql.org/docs/8.4/interactive/runtime-config-resource.html
> gives some good tips on the memory settings.
>
> Exactly which of the bits you'll benefit from tweaking does depend
> very much on your workload. Are you doing a lot of sorts, are you
> doing a lot of inserts/updates ... ?
>
> Regards
>
> Bell.
>
>

Responses

Browse jnbpug by date

  From Date Subject
Next Message renier 2010-04-09 10:57:11 Re: PostgreSQL Tweaking
Previous Message Corrie Strydom 2010-04-09 10:32:28 Re: PostgreSQL Tweaking