Re: High CPU load on Postgres Server during Peak times!!!!

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



>From: Shiva Raman
>Subject: Re:  High CPU load on Postgres Server during Peak
times!!!!
>
>Andy Colson Wrote :  , 
>>Eww.  I think that's bad.  A connection that has a transaction open will
cause lots of row versions, 
>>which use up ram, and make it slower to step through the table (even with
an index).  You really need 
>>to fix up your code and make sure you commit transactions.  (any statement
(select, insert, update) will 
>>start a new transaction that you need to explicitly commit).
>
>With reference to this suggestion by Andy Colson, we checked the
application code and found that only
>INSERT, UPDATE  has COMMIT  and SELECT has no commit, We are using a lot of
"Ajax Suggest" in the all 
>the forms accessed for fetching the data using SELECT statements which are
not explicitly committed. 
>We have started updating the code on this. 

You need a COMMIT for every BEGIN.  If you just run a SELECT statement
without first beginning a transaction, then you should not end up with a
connection that is Idle in Transaction.  If you are beginning a transaction,
doing a select, and then not committing, then yes that is a bug.

Dave


	


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

[Postgresql General]     [Postgresql PHP]     [PHP Users]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Yosemite]

  Powered by Linux