473,811 Members | 2,557 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

"Idle in Transaction" and hung connections

Dear peoples,

Periodically we are getting runaway postgres processes on our Linux (2.4.21-0.13 on Dell servers), using 7.4 and GIS (0.8 USE_GEOS=1 USE_PROJ=1 USE_STATS=1).

All of the queries come in from remote servers using JDBC/proxool; once every 4 hours we have a process on the client side that cleans out old connections.

All the processes are doing is single queries -- no inserts or updates.

Very occasionally we will see a thread go wild, taking up a huge amount of processor time (the load will climb by "1" for each process -- usual load is around .2, when these hit the load rises to 1.x all the way up to a load of about 40 once). The pg_stat_activit y shows these conections as being old-- much older than any live thread. All such connections are in a state of"IDLE IN TRANSACTION" which seems odd as these are all queries and presumably each query is a complete transaction. My tenative theory is that something is killing the client while the server side still thinks it has data tosend, or some such variant. The client machines don't have a correspondingco nnection to the one on the postgres server.

Killing the runaways with a -15 seems to bring the load back down and all is well, until it happens again.

Does anyone have any ideas what might be triggering this ? It is mostly an annoyance but on a couple of occasions seems to have brought down a server,or at least rendered it non-functional.

Thanks for any advice !

Greg Williamson
DBA
GlobeXplorer LLC

---------------------------(end of broadcast)---------------------------
TIP 6: Have you searched our list archives?

http://archives.postgresql.org

Nov 23 '05 #1
2 9511
"Gregory S. Williamson" <gs*@globexplor er.com> writes:
Very occasionally we will see a thread go wild, taking up a huge
amount of processor time (the load will climb by "1" for each process
-- usual load is around .2, when these hit the load rises to 1.x all
the way up to a load of about 40 once). The pg_stat_activit y shows
these conections as being old -- much older than any live thread. All
such connections are in a state of "IDLE IN TRANSACTION" which seems
odd
This is not unexpected due to the way JDBC (mis)uses BEGIN/COMMIT.
However it is strange that such a connection would start using
a significant amount of CPU time. It should be waiting for a new
client query.
Does anyone have any ideas what might be triggering this ?


No. Try attaching to a looping backend with gdb so you can get a stack
trace. I would suggest something along the lines of

gdb /path/to/postgres PID
bt
cont
... wait a few seconds, press control-C, and again do:
bt
cont
... lather, rinse, repeat a few times, then control-C and:
quit

Comparison of four or five stack traces obtained this way should make it
fairly clear where the loop is, and then we can determine whether we
need more info to solve it.

regards, tom lane

---------------------------(end of broadcast)---------------------------
TIP 5: Have you checked our extensive FAQ?

http://www.postgresql.org/docs/faqs/FAQ.html

Nov 23 '05 #2
"Gregory S. Williamson" <gs*@globexplor er.com> writes:
Very occasionally we will see a thread go wild, taking up a huge
amount of processor time (the load will climb by "1" for each process
-- usual load is around .2, when these hit the load rises to 1.x all
the way up to a load of about 40 once). The pg_stat_activit y shows
these conections as being old -- much older than any live thread. All
such connections are in a state of "IDLE IN TRANSACTION" which seems
odd
This is not unexpected due to the way JDBC (mis)uses BEGIN/COMMIT.
However it is strange that such a connection would start using
a significant amount of CPU time. It should be waiting for a new
client query.
Does anyone have any ideas what might be triggering this ?


No. Try attaching to a looping backend with gdb so you can get a stack
trace. I would suggest something along the lines of

gdb /path/to/postgres PID
bt
cont
... wait a few seconds, press control-C, and again do:
bt
cont
... lather, rinse, repeat a few times, then control-C and:
quit

Comparison of four or five stack traces obtained this way should make it
fairly clear where the loop is, and then we can determine whether we
need more info to solve it.

regards, tom lane

---------------------------(end of broadcast)---------------------------
TIP 5: Have you checked our extensive FAQ?

http://www.postgresql.org/docs/faqs/FAQ.html

Nov 23 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
2181
by: Lada 'Ray' Lostak | last post by:
Hi ! We are moving to PgSql application, with 'typical' style of work. Thin client, huge database. From database is (also) generated whole website. I will use it for explain my current todo. Right now, I am before solving following problem: Someone starts (let's say) adding 'new product'. It mean, he have to add records to many tables, gfxer have to create proper images and some XML/HTML code, ppl translating to other languages have...
1
1731
by: Jean-Marc Blaise | last post by:
Dear all, It seems to me the IY54968 apar (V8.2) does not correct totally the problem: db2start db2 connect to sample db2 get snapshot for db on sample | grep "oldest transaction" ==> What should be the result ? If I am not mistaken, it should be 0, as of version 7, as a "connect
3
2466
by: john | last post by:
I don't want to know what the CPU utilization is right now. I want to get the average utilization over the last, for example, hour. So I came up with a method where I would get a Process object representing the "Idle" process. I would figure out what percentage of time the idle process has been running since my function last was called. Then the average CPU utilization would be 100 - average idle percentage. I figure out the average idle...
3
27518
by: Ollie Riches | last post by:
"Distributed transaction completed. Either enlist this session in a new transaction or the NULL transaction." I am recieving the above error when attempt to access a remote sql server database 2000 (sp3a) from ADO.Net. The database is on a windows 2003 machine and the ado.net code (web services) are on another winsdows 2003 machine in the same domain. I have configure the DTC to allow transactions and followed the resolution in the...
1
2258
by: Axel Dahmen | last post by:
Hi, today I've had a strange DTS error: In one of my transformations I'd been using several Copy Column transformations + one ActiveX transformation using a lookup function. This lookup function uses a second connection to the same SQL server but to a different database. I'm using this function to populate a new column in a table with calculated values. The transformation didn't run, I got an "Transaction context in use by another...
0
667
by: Gregory S. Williamson | last post by:
Dear peoples, Periodically we are getting runaway postgres processes on our Linux (2.4.21-0.13 on Dell servers), using 7.4 and GIS (0.8 USE_GEOS=1 USE_PROJ=1 USE_STATS=1). All of the queries come in from remote servers using JDBC/proxool; once every 4 hours we have a process on the client side that cleans out old connections. All the processes are doing is single queries -- no inserts or updates. Very occasionally we will see a...
1
1426
by: optimistck | last post by:
A mistake was made and "old" transaction logs (and old backups) were deleted. It appears that a long living transaction was living in one of those logs. Now the EP shows (no items). The DBs themselves are still functioning OK, just the EP shell that's not working. What's the proper resolution? Thank you in advance, FBCK
2
17882
by: Martin Z | last post by:
I'm using the TableAdapterHelper to set the connection and transaction properties on all the commands of all my typed table adapters.... I've checked at the time of the error and all the commands have their Transaction property set. But I still get this error when I call... documentTA.Update(documentDS.Document); "ExecuteReader requires the command to have a transaction when the connection assigned to the command is in a pending local...
0
1292
by: fireball | last post by:
I installed Parallels Desktop and Win XP Pro on my iMac for testing purposes. I installed Python 2.5.2, wxPython, and PythonCard. I cannot get the "Open with IDLE" in an Explorer window to work. All the registry entries are there too. Any ideas? Thanks! Jay
0
9730
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9605
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10651
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10392
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
7671
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6893
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5555
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5693
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
3868
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.