[PERFORM] Disable-spinlocks while compiling postgres 9.1 for ARM Cortex A8

2012-02-23 Thread Jayashankar K B
Hi All,

I am trying to compile Postgres Source code for ARM cortex A8 architecture.
While compiling, I got an error message which read selected processor does not 
support `swpb r4,r4,[r3]' 
One of the Postgres forums at the location 
http://postgresql.1045698.n5.nabble.com/BUG-6331-Cross-compile-error-aborts-Works-if-disable-spinlock-is-used-td5068738.html;
Mentioned that by using -disable-spinlocks, we can overcome the error at the 
cost of performance. I did the same and it compiled successfully.
But the INSTALL guide in Postgres source code mentioned that I should inform 
the Postgres community in case I am forced to use -disable spinlocks to let the 
code compile.
Hence this email. So please suggest me what I should do now.  What sort of 
performance penalty will be there if I use this option? What actually is the 
significance of this parameter?
Please guide me.

This is the configure command I used
./configure CC=/opt/toolchain/bin/armv7l-timesys-linux-gnueabi-gcc 
--target=armv7l-timesys-linux-gnueabi 
--prefix=/home/jayashankar/WorkingDirectory/Postgres9.1_Cortex 
--host=x86_64-unknown-linux-gnu CFLAGS='-march=armv7-a -mtune=cortex-a8 
-mfpu=vfpv3 -mthumb' --disable-spinlocks

Thanks and Regards
Jayashankar



Larsen  Toubro Limited

www.larsentoubro.com

This Email may contain confidential or privileged information for the intended 
recipient (s) If you are not the intended recipient, please do not use or 
disseminate the information, notify the sender and delete it from your system.


Re: [PERFORM] Postgress is taking lot of CPU on our embedded hardware.

2012-01-28 Thread Jayashankar K B
Hi,

The number of inserts into the database would be a minimum of 3000 records in 
one operation.. We do not have any stringent requirement of writing speed.
So we could make do with a slower write speed as long as the CPU usage is not 
heavy... :)
We will try reducing the priority and check once.
Our database file is located on a class 2 SD Card. So it is understandable if 
there is lot of IO activity and speed is less.
But we are stumped by the amount of CPU Postgres is eating up.
Any configuration settings we could check up? Given our Hardware config, are 
following settings ok?
Shared Buffers: 24MB
Effective Cache Size: 128MB

We are not experienced with database stuff. So some expert suggestions would be 
helpful :)

Thanks and Regards
Jayashankar

-Original Message-
From: pgsql-performance-ow...@postgresql.org 
[mailto:pgsql-performance-ow...@postgresql.org] On Behalf Of Heikki Linnakangas
Sent: Saturday, January 28, 2012 1:27 AM
To: Jayashankar K B
Cc: Andy Colson; pgsql-performance@postgresql.org
Subject: Re: [PERFORM] Postgress is taking lot of CPU on our embedded hardware.

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

--
Sent via pgsql-performance mailing list (pgsql-performance@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-performance


Larsen  Toubro Limited

www.larsentoubro.com

This Email may contain confidential or privileged information for the intended 
recipient (s) If you are not the intended recipient, please do not use or 
disseminate the information, notify the sender and delete it from your system.

-- 
Sent via pgsql-performance mailing list (pgsql-performance@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-performance


Re: [PERFORM] Postgress is taking lot of CPU on our embedded hardware.

2012-01-28 Thread Jayashankar K B
Hi,

I downloaded the source code and cross compiled it into a relocatable package 
and copied it to the device.
LTIB was the cross-compile tool chain that was used. Controller is  coldfire 
MCF54418 CPU.
Here is the configure options I used.

./configure 
CC=/opt/freescale/usr/local/gcc-4.4.54-eglibc-2.10.54/m68k-linux/bin/m68k-linux-gnu-gcc
 CFLAGS='-fmessage-length=0 -fpack-struct -mcpu=54418 -msoft-float' 
--host=i686-pc-linux-gnu --target=m68k-linux-gnu 
--prefix=/home/jayashankar/databases/Postgre_8.4.9_relocatable/

Any other special flags that could be of help to us?

Thanks and Regards
Jayashankar

-Original Message-
From: Claudio Freire [mailto:klaussfre...@gmail.com]
Sent: Saturday, January 28, 2012 7:54 AM
To: Heikki Linnakangas
Cc: Jayashankar K B; Andy Colson; pgsql-performance@postgresql.org
Subject: Re: [PERFORM] Postgress is taking lot of CPU on our embedded hardware.

On Fri, Jan 27, 2012 at 4:56 PM, Heikki Linnakangas 
heikki.linnakan...@enterprisedb.com wrote:
 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.

How did you install postgres?
Did you build it?
Which configure flags did you use?
Exactly which m68k cpu is it? (it does matter)

For instance...

wiki: However, a significant difference is that the 68060 FPU is not pipelined 
and is therefore up to three times slower than the Pentium in floating point 
applications

This means, if you don't configure the build correctly, you will get really 
sub-optimal code. Modern versions are optimized for modern cpus.
Of utmost importance, I would imagine, is the binary format chosen for pg data 
types (floating types especially, if you use them).


Larsen  Toubro Limited

www.larsentoubro.com

This Email may contain confidential or privileged information for the intended 
recipient (s) If you are not the intended recipient, please do not use or 
disseminate the information, notify the sender and delete it from your system.

-- 
Sent via pgsql-performance mailing list (pgsql-performance@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-performance


[PERFORM] Postgress is taking lot of CPU on our embedded hardware.

2012-01-27 Thread Jayashankar K B
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.
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. 1 records 
having between 10 and 20 columns).
Please let us know how we can reduce CPU usage for the postgres.

Thanks and Regards
Jayashankar



Larsen  Toubro Limited

www.larsentoubro.com

This Email may contain confidential or privileged information for the intended 
recipient (s) If you are not the intended recipient, please do not use or 
disseminate the information, notify the sender and delete it from your system.


Re: [PERFORM] Postgress is taking lot of CPU on our embedded hardware.

2012-01-27 Thread Jayashankar K B
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.

Hi Andy: As of now, there are no triggers in the table.

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.
We are starting to feel if Postgres was a good choice for us..!

Thanks and Regards
Jay

-Original Message-
From: Andy Colson [mailto:a...@squeakycode.net]
Sent: Friday, January 27, 2012 10:45 PM
To: Heikki Linnakangas
Cc: Jayashankar K B; pgsql-performance@postgresql.org
Subject: Re: [PERFORM] Postgress is taking lot of CPU on our embedded hardware.

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. 1
 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?




Larsen  Toubro Limited

www.larsentoubro.com

This Email may contain confidential or privileged information for the intended 
recipient (s) If you are not the intended recipient, please do not use or 
disseminate the information, notify the sender and delete it from your system.

-- 
Sent via pgsql-performance mailing list (pgsql-performance@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-performance