pg.ddx.io  pgsql-general@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Kevin Wilkinson <w.kevin.wilkinson@gmail.com>
To: pgsql-general@postgresql.org
Subject: 10.2: high cpu usage on update statement
Date: Fri, 5 Apr 2019 15:45:26 -0700
Message-ID: <214e8730-17b5-16be-afd6-8b6175dd15ab@gmail.com> (raw)

on 10.2, we're seeing very high cpu usage when doing an update statement 
on a relatively small table (1GB). one of the updated columns is text, 
about 1k bytes. there are four threads doing similar updates 
concurrently to the same table (but different rows). each thread does an 
update about every two seconds, i.e., the tables gets updated every 1/2 
second. the stack trace below shows the process stuck in reading the 
update results. this seems very odd. has anyone seen something similar?  
this is a modest server of 8 cores, all of which are 90% busy.

thanks,

kevin

---- stack trace ---

"pool-2-thread-1" #61 prio=5 os_prio=0 tid=0x00007efd0811f000 
nid=0x1fc85a runnable [0x00007efcdcfcc000]
   java.lang.Thread.State: RUNNABLE
     at java.net.SocketInputStream.socketRead0(Native Method)
     at java.net.SocketInputStream.socketRead(SocketInputStream.java:116)
     at java.net.SocketInputStream.read(SocketInputStream.java:171)
     at java.net.SocketInputStream.read(SocketInputStream.java:141)
     at 
org.postgresql.core.VisibleBufferedInputStream.readMore(VisibleBufferedInputStream.java:140)
     at 
org.postgresql.core.VisibleBufferedInputStream.ensureBytes(VisibleBufferedInputStream.java:109)
     at 
org.postgresql.core.VisibleBufferedInputStream.read(VisibleBufferedInputStream.java:67)
     at org.postgresql.core.PGStream.receiveChar(PGStream.java:293)
     at 
org.postgresql.core.v3.QueryExecutorImpl.processResults(QueryExecutorImpl.java:1938)
     at 
org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java:306)
     - locked <0x00000006406504c0> (a 
org.postgresql.core.v3.QueryExecutorImpl)
     at 
org.postgresql.jdbc.PgStatement.executeInternal(PgStatement.java:441)
     at org.postgresql.jdbc.PgStatement.execute(PgStatement.java:365)
     at 
org.postgresql.jdbc.PgPreparedStatement.executeWithFlags(PgPreparedStatement.java:155)
     at 
org.postgresql.jdbc.PgPreparedStatement.executeUpdate(PgPreparedStatement.java:132)
     at ...

--- end stack trace ---






view thread (4+ messages)  latest in thread

Message-ID: <214e8730-17b5-16be-afd6-8b6175dd15ab@gmail.com>
Permalink:  ../214e8730-17b5-16be-afd6-8b6175dd15ab@gmail.com/
Also on:    postgresql.org/message-id/214e8730-17b5-16be-afd6-8b6175dd15ab@gmail.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-general@postgresql.org
  Cc: w.kevin.wilkinson@gmail.com
  Subject: Re: 10.2: high cpu usage on update statement
  In-Reply-To: <214e8730-17b5-16be-afd6-8b6175dd15ab@gmail.com>
  References: <214e8730-17b5-16be-afd6-8b6175dd15ab@gmail.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox