Received: from magus.postgresql.org (magus.postgresql.org [87.238.57.229]) by mail.postgresql.org (Postfix) with ESMTP id D5ED81259185 for ; Fri, 27 Jan 2012 12:48:02 -0400 (AST) Received: from exprod7og114.obsmtp.com ([64.18.2.215]) by magus.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1Rqoxv-0006L2-KW for pgsql-performance@postgresql.org; Fri, 27 Jan 2012 16:48:02 +0000 Received: from mail-lpp01m020-f182.google.com ([209.85.217.182]) (using TLSv1) by exprod7ob114.postini.com ([64.18.6.12]) with SMTP ID DSNKTyLVLcXtc/ndrMJ92kwwZyrTXHGl5dvb@postini.com; Fri, 27 Jan 2012 08:47:55 PST Received: by lbao2 with SMTP id o2so180658lba.27 for ; Fri, 27 Jan 2012 08:47:39 -0800 (PST) Received: by 10.112.85.199 with SMTP id j7mr2010972lbz.26.1327682859637; Fri, 27 Jan 2012 08:47:39 -0800 (PST) Received: from [192.168.1.102] (dsl-hkibrasgw2-ff6cc300-200.dhcp.inet.fi. [88.195.108.200]) by mx.google.com with ESMTPS id q1sm6271526lbf.15.2012.01.27.08.47.38 (version=TLSv1/SSLv3 cipher=OTHER); Fri, 27 Jan 2012 08:47:38 -0800 (PST) Message-ID: <4F22D528.6090604@enterprisedb.com> Date: Fri, 27 Jan 2012 18:47:36 +0200 From: Heikki Linnakangas User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:8.0) Gecko/20120104 Icedove/8.0 MIME-Version: 1.0 To: Jayashankar K B CC: "pgsql-performance@postgresql.org" Subject: Re: Postgress is taking lot of CPU on our embedded hardware. References: <1365276B7BDA4C40A519F0B4088230B3096F3B17@POCITMSEXMB03.LntUniverse.com> In-Reply-To: <1365276B7BDA4C40A519F0B4088230B3096F3B17@POCITMSEXMB03.LntUniverse.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Pg-Spam-Score: -4.2 (----) X-Archive-Number: 201201/89 X-Sequence-Number: 46101 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. If you can run something like oprofile on the system, that would be helpful to pinpoint the expensive part. -- Heikki Linnakangas EnterpriseDB http://www.enterprisedb.com