X-Original-To: pgsql-performance-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [64.117.224.130]) by svr1.postgresql.org (Postfix) with ESMTP id 66603D1C4CA for ; Thu, 7 Aug 2003 08:24:49 +0000 (GMT) Received: from svr1.postgresql.org ([64.117.224.193]) by localhost (neptune.hub.org [64.117.224.130]) (amavisd-new, port 10024) with ESMTP id 51584-01 for ; Thu, 7 Aug 2003 05:23:26 -0300 (ADT) Received: from fw.wubn.net (unknown [213.156.64.226]) by svr1.postgresql.org (Postfix) with ESMTP id 20A48D1C50B for ; Thu, 7 Aug 2003 05:24:35 -0300 (ADT) Received: from (172.24.4.34) by fw.wubn.net (8.12.9/8.11.3) with ESMTP id h778OTPt045602 for ; Thu, 7 Aug 2003 11:24:34 +0300 (EEST) (envelope-from yamazurak@Lviv.Bank.Gov.UA) Received: from (172.24.4.57) by MTA (8.11.5/8.11.2) with ESMTP id h778OTf08176 for ; Thu, 7 Aug 2003 11:24:29 +0300 Message-ID: <3F320CB1.7040000@lviv.bank.gov.ua> Date: Thu, 07 Aug 2003 11:24:17 +0300 From: Yaroslav Mazurak Organization: National Bank of Ukraine Lviv OU User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.4) Gecko/20030624 X-Accept-Language: uk, ru, en-us, en MIME-Version: 1.0 To: pgsql-performance@postgresql.org Subject: Re: PostgreSQL performance problem -> tuning References: <49274.192.168.1.32.1060184304.squirrel@mainbox.archonet.com> <3F324F18.6307.4A8BB7A@localhost> In-Reply-To: <3F324F18.6307.4A8BB7A@localhost> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200308/130 X-Sequence-Number: 2947 Hi All! Shridhar Daithankar wrote: > On 7 Aug 2003 at 10:05, Yaroslav Mazurak wrote: >>>It needs to reflect how much cache the system is using - try the "free" >>>command to see figures. >> I'm not found "free" utility on FreeBSD 4.7. :( > > Grr.. I don't like freeBSD for it's top output.Active/inactive/Wired.. Grr.. > why can't it be shared buffered and cached? Same goes for HP-UX top. Looking at > it one gets hardly any real information.. Anyway that's just me.. > Grr... I don't like PostgreSQL for it's memory usage parameters. In Sybase ASA, I say for example: "use 64Mb RAM for cache". I don't worry about data in this cache - this may be queries, sort areas, results etc. I think that server know better about it's memory requirements. I know that Sybase *use*, and use *only this* memory and don't trap with "Memory exhausted" error. I'm not remember 700 minutes queries (more complex that my query), following with "memory exhausted" error, on Sybase. Advertising, he? :( > Top on freeBSD seems pretty unintuituive em but if you find any documentation > on that, that would help you. (Haven't booted in freeBSD in ages so no data > out of my head..) > You can try various sysctls on freeBSD. Basicalyl idea is to find out how much > of memory is used and how much is cached. FreeBSD must be providing that one in > some form.. > IIRC there is a limit on filesystem cache on freeBSD. 300MB by default. If that > is the case, you might have to raise it to make effective_cache_size really > effective.. "Try various sysctls" says nothing for me. I want use *all available RAM* (of course, without needed for OS use) for PostgreSQL. While idle time top says: Mem: 14M Active, 1944K Inact, 28M Wired, 436K Cache, 48M Buf, 331M Free Swap: 368M Total, 17M Used, 352M Free, 4% Inuse After 1 minute of "EXPLAIN ANALYZE SELECT SUM(showcalc('B00204', dd, r020, t071)) FROM v_file02wide WHERE a011 = 3 AND inrepdate(data) AND b030 IN (SELECT b030 FROM dov_bank WHERE dov_bank_box_22(box) IN ('NL', 'NM')) AND r030 = 980;" executing: Mem: 64M Active, 17M Inact, 72M Wired, 436K Cache, 48M Buf, 221M Free Swap: 368M Total, 3192K Used, 365M Free PID USERNAME PRI NICE SIZE RES STATE TIME WCPU CPU COMMAND 59063 postgres 49 0 65560K 55492K RUN 1:06 94.93% 94.63% postgres After 12 minutes of query executing: Mem: 71M Active, 17M Inact, 72M Wired, 436K Cache, 48M Buf, 214M Free Swap: 368M Total, 3192K Used, 365M Free PID USERNAME PRI NICE SIZE RES STATE TIME WCPU CPU COMMAND 59063 postgres 56 0 73752K 62996K RUN 12:01 99.02% 99.02% postgres I suspect that swap-file size is too small for my query... but query isn't too large, about 8K rows only. :-| > Shridhar With best regards Yaroslav Mazurak.