От: joël Winteregg
Тема: Re: Insert performance
Дата: ,
Msg-id: 1173167607.4917.8.camel@hatman
(см: обсуждение, исходный текст)
Ответ на: Re: Insert performance  (Richard Huxton)
Список: pgsql-performance

Скрыть дерево обсуждения

Insert performance  ("hatman", )
 Re: Insert performance  (Richard Huxton, )
  Re: Insert performance  (joël Winteregg, )
 Re: Insert performance  (Richard Huxton, )
  Re: Insert performance  (joël Winteregg, )
 Re: Insert performance  (Richard Huxton, )
  Re: Insert performance  (Andreas Kostyrka, )
   Re: Insert performance  (Richard Huxton, )
    Re: Insert performance  (Andreas Kostyrka, )
   Re: Insert performance  ("hatman", )
  Re: Insert performance  (Carlos Moreno, )
   Re: Insert performance  (Csaba Nagy, )
    Re: Insert performance  (Carlos Moreno, )
  Re: Insert performance  ("hatman", )

Hi Richard,

> >
> > Here is my problem. With some heavy insert into a simple BD (one
> > table, no indexes) i can't get better perf than 8000 inserts/sec. I'm
> > testing it using a simple C software which use libpq and which use:
> > - Insert prepared statement (to avoid too many request parsing on the
> > server)
> > - transaction of 100000 inserts
>
> Are each of the INSERTs in their own transaction?
>

No, as said above transactions are made of 100000 inserts...

> If so, you'll be limited by the speed of the disk the WAL is running on.
>
> That means you have two main options:
> 1. Have multiple connections inserting simultaneously.

Yes, you're right. That what i have been testing and what provide the
best performance ! I saw that postgresql frontend was using a lot of CPU
and not both of them (i'm using a pentium D, dual core). To the opposit,
the postmaster process use not much resources. Using several client,
both CPU are used and i saw an increase of performance (about 18000
inserts/sec).

So i think my bottle neck is more the CPU speed than the disk speed,
what do you think ?

I use 2 disks (raid 0) for the data and a single disk for pg_xlog.

> 2. Batch your inserts together, from 10 to 10,000 per transaction.
>

Yes, that's what i'm doing.


Thanks a lot for the advices !


regards,


Joël





В списке pgsql-performance по дате сообщения:

От: "James Mansion"
Дата:
Сообщение: Re: compact flash disks?
От: "Bruce McAlister"
Дата:
Сообщение: Re: PostgreSQL 8.2.3 VACUUM Timings/Performance