Received: from makus.postgresql.org (makus.postgresql.org [98.129.198.125]) by mail.postgresql.org (Postfix) with ESMTP id 6ACDB1259185 for ; Fri, 27 Jan 2012 13:15:04 -0400 (AST) Received: from li339-205.members.linode.com ([96.126.114.205] helo=squeakycode.net) by makus.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1RqpOC-0003xM-86 for pgsql-performance@postgresql.org; Fri, 27 Jan 2012 17:15:04 +0000 Received: from [192.168.10.84] (97-64-237-59.client.mchsi.com [97.64.237.59]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) (Authenticated sender: andy) by squeakycode.net (Postfix) with ESMTPSA id AC49116822; Fri, 27 Jan 2012 11:14:54 -0600 (CST) Message-ID: <4F22DB8A.4080104@squeakycode.net> Date: Fri, 27 Jan 2012 11:14:50 -0600 From: Andy Colson User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:9.0) Gecko/20111222 Thunderbird/9.0.1 MIME-Version: 1.0 To: Heikki Linnakangas CC: Jayashankar K B , "pgsql-performance@postgresql.org" Subject: Re: Postgress is taking lot of CPU on our embedded hardware. References: <1365276B7BDA4C40A519F0B4088230B3096F3B17@POCITMSEXMB03.LntUniverse.com> <4F22D528.6090604@enterprisedb.com> In-Reply-To: <4F22D528.6090604@enterprisedb.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Pg-Spam-Score: -1.9 (-) X-Archive-Number: 201201/90 X-Sequence-Number: 46102 On 1/27/2012 10:47 AM, Heikki Linnakangas wrote: > On 27.01.2012 15:34, Jayashankar K B wrote: >> Hi, >> >> We are having an embedded system with a freescale m68k architecture >> based micro-controller, 256MB RAM running a customized version of >> Slackware 12 linux. >> It's a relatively modest Hardware. > > Fascinating! > >> We have installed postgres 9.1 as our database engine. While testing, >> we found that the Postgres operations take more than 70% of CPU and >> the average also stays above 40%. >> This is suffocating the various other processes running on the system. >> Couple of them are very critical ones. >> The testing involves inserting bulk number of records (approx. 10000 >> records having between 10 and 20 columns). >> Please let us know how we can reduce CPU usage for the postgres. > > The first step would be to figure out where all the time is spent. Are > there unnecessary indexes you could remove? Are you using INSERT > statements or COPY? Sending the data in binary format instead of text > might shave some cycles. > Do you have triggers on the table?