Re: Troubles with performances

Поиск
Список
Период
Сортировка
От Guillaume Lémery
Тема Re: Troubles with performances
Дата
Msg-id 3A6BF187.1070308@comclick.com
обсуждение исходный текст
Ответ на Troubles with performances  (Guillaume Lémery <glemery@comclick.com>)
Ответы Re: Troubles with performances
Список pgsql-general
> A few quick thoughts:
>   200 simultaneous queries sounds like a lot
> to me, and suggests you might be CPU-bound.
Yes, in 'top' CPU usage is 99%...

> Here are the things you should try:
>
> 1) Put PostgreSQL on a separate server from your
>    Web server/application logic.  If you are CPU-bound,
>    then this can greatly improve your throughput.
I don't really think my Web Server uses a lot of CPU, because my
application is written in a module .so and it does only queries to my
database.

> 2) After doing #1, watch the CPU load on both database
>    and web server machines.  If your web server is the
>    bottleneck, try running multiple web servers.
I was wondering to have 2 web servers per database server, but if you
say that 200 simultaneous queries is a lot.. what about 400 ? :-(

> 3) After trying #1, if your database is the bottleneck
>    and your data will all fit into RAM, try redesigning
>    your web application to run entirely from memory.
>    With this design, you would only do UPDATEs on each
>    page; SELECTs would be done directly from data
>    you've stored in memory.  This dramatically reduces
>    database traffic.  However, it makes it hard to
>    run multiple web servers and also creates problems if
>    you have other applications updating the database.
I don't know how to put the data in memormy to increase performance...
What should I do ?

> This assumes, of course, that you've carefully studied
> and optimized the performance of your code.  In my experience,
> application performance is usually the bottleneck, not
> the database.  Each of the above strategies is appropriate
> in different circumstances.
Well, with all the performance problems, I tried to optimize my code
everywhere I could.
All I can do now is to change the way I pass the queries to the database...

Thank you for all the advices.

Guillaume


В списке pgsql-general по дате отправления:

Предыдущее
От: Zachary Beane
Дата:
Сообщение: Re: 'enum' equivalent?
Следующее
От: chris@future-i.com
Дата:
Сообщение: System tables