Received: from makus.postgresql.org (makus.postgresql.org [98.129.198.125]) by mail.postgresql.org (Postfix) with ESMTP id C13891259188 for ; Fri, 27 Jan 2012 15:57:15 -0400 (AST) Received: from exprod7og111.obsmtp.com ([64.18.2.175]) by makus.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1Rqrv4-0006n1-UW for pgsql-performance@postgresql.org; Fri, 27 Jan 2012 19:57:16 +0000 Received: from mail-lpp01m010-f43.google.com ([209.85.215.43]) (using TLSv1) by exprod7ob111.postini.com ([64.18.6.12]) with SMTP ID DSNKTyMBiRuiNW8JTL4HvcmYJEX9V6XuHu2o@postini.com; Fri, 27 Jan 2012 11:57:10 PST Received: by lago2 with SMTP id o2so2654271lag.30 for ; Fri, 27 Jan 2012 11:56:56 -0800 (PST) Received: by 10.112.83.7 with SMTP id m7mr2149591lby.44.1327694216191; Fri, 27 Jan 2012 11:56:56 -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 mo12sm6702990lab.2.2012.01.27.11.56.54 (version=TLSv1/SSLv3 cipher=OTHER); Fri, 27 Jan 2012 11:56:55 -0800 (PST) Message-ID: <4F230185.8020203@enterprisedb.com> Date: Fri, 27 Jan 2012 21:56:53 +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: Andy Colson , "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> <4F22DB8A.4080104@squeakycode.net> <1365276B7BDA4C40A519F0B4088230B3096F3C0D@POCITMSEXMB03.LntUniverse.com> In-Reply-To: <1365276B7BDA4C40A519F0B4088230B3096F3C0D@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/96 X-Sequence-Number: 46108 On 27.01.2012 20:30, Jayashankar K B wrote: > Hi Heikki Linnakangas: We are using series of Insert statements to insert the records into database. > Sending data in binary is not an option as the module that writes into DB has been finalized. > We do not have control over that. That certainly limits your options. > Please let me know how we can proceed. On the net I couldn't get hold of any good example where Postgres has been used on limited Hardware system. I don't think there's anything particular in postgres that would make it a poor choice on a small system, as far as CPU usage is concerned anyway. But inserting rows in a database is certainly slower than, say, writing them into a flat file. At what rate are you doing the INSERTs? And how fast would they need to be? Remember that it's normal that while the INSERTs are running, postgres will use all the CPU it can to process them as fast as possible. So the question is, at what rate do they need to be processed to meet your target. Lowering the process priority with 'nice' might help too, to give the other important processes priority over postgres. The easiest way to track down where the time is spent would be to run a profiler, if that's possible on your platform. -- Heikki Linnakangas EnterpriseDB http://www.enterprisedb.com