Thread: Thousands of semops for every i/o

Thousands of semops for every i/o

From
"Jeffrey W. Baker"
Date:
This is the strace of a process which is deleting rows from four tables,
inside a transaction, one row at a time.  There are a lot of semops for
every i/o.  There are about 30 connections to this database currently.
I thought deletes in a transaction just flew along in Pg, because they
simply wrote the deleted transaction ID on the record.  It used to work
fine in my previous locally-built 7.2 on Debian, but this is 7.2.2 on
SuSE Enterprise Server 8.2.

Is there any way to prevent this?

semop(15106509, 0x7fbfffec60, 1)        = 0
semop(15106509, 0x7fbfffec30, 1)        = 0
semop(15106509, 0x7fbfffec40, 1)        = 0
semop(15106509, 0x7fbfffec50, 1)        = 0
semop(15106509, 0x7fbfffec60, 1)        = 0
semop(15106509, 0x7fbfffec30, 1)        = 0
semop(15106509, 0x7fbfffec40, 1)        = 0
semop(15106509, 0x7fbfffec50, 1)        = 0
semop(15106509, 0x7fbfffec60, 1)        = 0
semop(15106509, 0x7fbfffec30, 1)        = 0
semop(15106509, 0x7fbfffec40, 1)        = 0
semop(15106509, 0x7fbfffec50, 1)        = 0
semop(15106509, 0x7fbfffec60, 1)        = 0
semop(0, 0x7fbfffebf0, 1)               = 0
semop(0, 0x7fbfffec00, 1)               = 0
semop(11862378, 0x7fbfffeb80, 1)        = 0
semop(11862378, 0x7fbfffeb90, 1)        = 0
semop(0, 0x7fbfffebc0, 1)               = 0
semop(0, 0x7fbfffebd0, 1)               = 0
read(58, "\4\0\0\0(\32\212\206\v\0\0\0\360\1 \2\0 \0 \300\237|\0"...,
8192) = 8192
semop(0, 0x7fbfffebf0, 1)               = 0
semop(0, 0x7fbfffec00, 1)               = 0
semop(11862378, 0x7fbfffec00, 1)        = 0
semop(11862378, 0x7fbfffec10, 1)        = 0
semop(0, 0x7fbfffec10, 1)               = 0
semop(0, 0x7fbfffec20, 1)               = 0
semop(11862378, 0x7fbfffec30, 1)        = 0
semop(11862378, 0x7fbfffec40, 1)        = 0
semop(11862378, 0x7fbfffec50, 1)        = 0
semop(11862378, 0x7fbfffec60, 1)        = 0
semop(0, 0x7fbfffecb0, 1)               = 0
semop(0, 0x7fbfffecc0, 1)               = 0
semop(0, 0x7fbfffecd0, 1)               = 0
semop(0, 0x7fbfffece0, 1)               = 0
semop(11862378, 0x7fbfffec30, 1)        = 0
semop(11862378, 0x7fbfffec40, 1)        = 0
semop(11862378, 0x7fbfffec50, 1)        = 0
semop(11862378, 0x7fbfffec60, 1)        = 0
semop(11862378, 0x7fbfffec30, 1)        = 0
semop(11862378, 0x7fbfffec40, 1)        = 0
semop(11862378, 0x7fbfffec50, 1)        = 0
semop(11862378, 0x7fbfffec60, 1)        = 0
semop(11862378, 0x7fbfffec30, 1)        = 0
semop(11862378, 0x7fbfffec40, 1)        = 0
semop(11862378, 0x7fbfffec50, 1)        = 0
semop(11862378, 0x7fbfffec60, 1)        = 0
semop(11862378, 0x7fbfffec30, 1)        = 0
semop(11862378, 0x7fbfffec40, 1)        = 0
semop(11862378, 0x7fbfffec50, 1)        = 0
semop(11862378, 0x7fbfffec60, 1)        = 0
semop(11862378, 0x7fbfffec30, 1)        = 0
semop(11862378, 0x7fbfffec40, 1)        = 0
semop(11862378, 0x7fbfffec50, 1)        = 0
semop(11862378, 0x7fbfffec60, 1)        = 0
semop(11862378, 0x7fbfffec30, 1)        = 0
semop(11862378, 0x7fbfffec40, 1)        = 0
semop(11862378, 0x7fbfffec50, 1)        = 0
semop(11862378, 0x7fbfffec60, 1)        = 0
semop(11862378, 0x7fbfffec30, 1)        = 0
semop(11862378, 0x7fbfffec40, 1)        = 0
semop(11862378, 0x7fbfffec50, 1)        = 0
semop(11862378, 0x7fbfffec60, 1)        = 0
semop(11862378, 0x7fbfffec30, 1)        = 0
semop(11862378, 0x7fbfffec40, 1)        = 0
semop(11862378, 0x7fbfffec50, 1)        = 0
semop(11862378, 0x7fbfffec60, 1)        = 0
semop(11862378, 0x7fbfffec30, 1)        = 0
semop(11862378, 0x7fbfffec40, 1)        = 0
semop(11862378, 0x7fbfffec50, 1)        = 0
semop(11862378, 0x7fbfffec60, 1)        = 0
semop(11862378, 0x7fbfffec30, 1)        = 0
semop(11862378, 0x7fbfffec40, 1)        = 0
semop(11862378, 0x7fbfffec50, 1)        = 0
semop(11862378, 0x7fbfffec60, 1)        = 0
semop(11862378, 0x7fbfffec30, 1)        = 0
semop(11862378, 0x7fbfffec40, 1)        = 0
semop(11862378, 0x7fbfffec50, 1)        = 0
semop(11862378, 0x7fbfffec60, 1)        = 0
semop(11862378, 0x7fbfffec30, 1)        = 0
semop(11862378, 0x7fbfffec40, 1)        = 0
semop(11862378, 0x7fbfffec50, 1)        = 0
semop(11862378, 0x7fbfffec60, 1)        = 0
semop(11862378, 0x7fbfffec30, 1)        = 0
semop(11862378, 0x7fbfffec40, 1)        = 0
semop(11862378, 0x7fbfffec50, 1)        = 0
semop(11862378, 0x7fbfffec60, 1)        = 0
semop(11862378, 0x7fbfffec30, 1)        = 0
semop(11862378, 0x7fbfffec40, 1)        = 0
semop(11862378, 0x7fbfffec50, 1)        = 0
semop(11862378, 0x7fbfffec60, 1)        = 0
semop(11862378, 0x7fbfffec30, 1)        = 0
semop(11862378, 0x7fbfffec40, 1)        = 0
semop(11862378, 0x7fbfffec50, 1)        = 0
semop(11862378, 0x7fbfffec60, 1)        = 0
semop(11862378, 0x7fbfffec30, 1)        = 0
semop(11862378, 0x7fbfffec40, 1)        = 0
semop(11862378, 0x7fbfffec50, 1)        = 0
semop(11862378, 0x7fbfffec60, 1)        = 0
semop(11862378, 0x7fbfffec30, 1)        = 0
semop(11862378, 0x7fbfffec40, 1)        = 0
semop(11862378, 0x7fbfffec50, 1)        = 0
semop(11862378, 0x7fbfffec60, 1)        = 0
semop(11862378, 0x7fbfffec30, 1)        = 0
semop(11862378, 0x7fbfffec40, 1)        = 0
semop(11862378, 0x7fbfffec50, 1)        = 0
semop(11862378, 0x7fbfffec60, 1)        = 0
semop(11862378, 0x7fbfffec30, 1)        = 0
semop(11862378, 0x7fbfffec40, 1)        = 0
semop(11862378, 0x7fbfffec50, 1)        = 0
semop(11862378, 0x7fbfffec60, 1)        = 0
semop(11862378, 0x7fbfffec30, 1)        = 0
semop(11862378, 0x7fbfffec40, 1)        = 0
semop(11862378, 0x7fbfffec50, 1)        = 0
semop(11862378, 0x7fbfffec60, 1)        = 0
semop(11862378, 0x7fbfffec30, 1)        = 0
semop(11862378, 0x7fbfffec40, 1)        = 0
semop(11862378, 0x7fbfffec50, 1)        = 0
semop(11862378, 0x7fbfffec60, 1)        = 0
semop(11862378, 0x7fbfffec30, 1)        = 0
semop(11862378, 0x7fbfffec40, 1)        = 0
semop(11862378, 0x7fbfffec50, 1)        = 0
semop(11862378, 0x7fbfffec60, 1)        = 0
semop(11862378, 0x7fbfffec30, 1)        = 0
semop(11862378, 0x7fbfffec40, 1)        = 0
semop(11862378, 0x7fbfffec50, 1)        = 0
semop(11862378, 0x7fbfffec60, 1)        = 0
semop(11862378, 0x7fbfffec30, 1)        = 0
semop(11862378, 0x7fbfffec40, 1)        = 0
semop(11862378, 0x7fbfffec50, 1)        = 0
semop(11862378, 0x7fbfffec60, 1)        = 0
semop(11862378, 0x7fbfffec30, 1)        = 0
semop(11862378, 0x7fbfffec40, 1)        = 0
semop(11862378, 0x7fbfffec50, 1)        = 0
semop(11862378, 0x7fbfffec60, 1)        = 0
semop(11862378, 0x7fbfffec30, 1)        = 0
semop(11862378, 0x7fbfffec40, 1)        = 0
semop(11862378, 0x7fbfffec50, 1)        = 0
semop(11862378, 0x7fbfffec60, 1)        = 0
semop(11862378, 0x7fbfffec30, 1)        = 0
semop(11862378, 0x7fbfffec40, 1)        = 0
semop(11862378, 0x7fbfffec50, 1)        = 0
semop(11862378, 0x7fbfffec60, 1)        = 0
semop(11862378, 0x7fbfffec30, 1)        = 0
semop(11862378, 0x7fbfffec40, 1)        = 0
semop(11862378, 0x7fbfffec50, 1)        = 0
semop(11862378, 0x7fbfffec60, 1)        = 0
semop(11862378, 0x7fbfffec30, 1)        = 0
semop(11862378, 0x7fbfffec40, 1)        = 0
semop(11862378, 0x7fbfffec50, 1)        = 0
semop(11862378, 0x7fbfffec60, 1)        = 0
semop(11862378, 0x7fbfffec30, 1)        = 0
semop(11862378, 0x7fbfffec40, 1)        = 0
semop(11862378, 0x7fbfffec50, 1)        = 0
semop(11862378, 0x7fbfffec60, 1)        = 0
semop(11862378, 0x7fbfffec30, 1)        = 0
semop(11862378, 0x7fbfffec40, 1)        = 0
semop(11862378, 0x7fbfffec50, 1)        = 0
semop(11862378, 0x7fbfffec60, 1)        = 0
semop(11862378, 0x7fbfffec30, 1)        = 0
semop(11862378, 0x7fbfffec40, 1)        = 0
semop(11862378, 0x7fbfffec50, 1)        = 0
semop(11862378, 0x7fbfffec60, 1)        = 0
semop(11862378, 0x7fbfffec30, 1)        = 0
semop(11862378, 0x7fbfffec40, 1)        = 0
semop(11862378, 0x7fbfffec50, 1)        = 0
semop(11862378, 0x7fbfffec60, 1)        = 0
semop(11862378, 0x7fbfffec30, 1)        = 0
semop(11862378, 0x7fbfffec40, 1)        = 0
semop(11862378, 0x7fbfffec50, 1)        = 0
semop(11862378, 0x7fbfffec60, 1)        = 0
semop(11862378, 0x7fbfffec30, 1)        = 0
semop(11862378, 0x7fbfffec40, 1)        = 0
semop(11862378, 0x7fbfffec50, 1)        = 0
semop(11862378, 0x7fbfffec60, 1)        = 0
semop(11862378, 0x7fbfffec30, 1)        = 0
semop(11862378, 0x7fbfffec40, 1)        = 0
semop(11862378, 0x7fbfffec50, 1)        = 0
semop(11862378, 0x7fbfffec60, 1)        = 0
semop(11862378, 0x7fbfffec30, 1)        = 0
semop(11862378, 0x7fbfffec40, 1)        = 0
semop(11862378, 0x7fbfffec50, 1)        = 0
semop(11862378, 0x7fbfffec60, 1)        = 0
semop(11862378, 0x7fbfffec30, 1)        = 0
semop(11862378, 0x7fbfffec40, 1)        = 0
semop(11862378, 0x7fbfffec50, 1)        = 0
semop(11862378, 0x7fbfffec60, 1)        = 0
semop(11862378, 0x7fbfffec30, 1)        = 0
semop(11862378, 0x7fbfffec40, 1)        = 0
semop(11862378, 0x7fbfffec50, 1)        = 0
semop(11862378, 0x7fbfffec60, 1)        = 0
semop(11862378, 0x7fbfffec30, 1)        = 0
semop(11862378, 0x7fbfffec40, 1)        = 0
semop(11862378, 0x7fbfffec50, 1)        = 0
semop(11862378, 0x7fbfffec60, 1)        = 0
semop(11862378, 0x7fbfffec30, 1)        = 0
semop(11862378, 0x7fbfffec40, 1)        = 0
semop(11862378, 0x7fbfffec50, 1)        = 0
semop(11862378, 0x7fbfffec60, 1)        = 0
semop(11862378, 0x7fbfffec30, 1)        = 0
semop(11862378, 0x7fbfffec40, 1)        = 0
semop(11862378, 0x7fbfffec50, 1)        = 0
semop(11862378, 0x7fbfffec60, 1)        = 0
semop(11862378, 0x7fbfffec30, 1)        = 0
semop(11862378, 0x7fbfffec40, 1)        = 0
semop(11862378, 0x7fbfffec50, 1)        = 0
semop(11862378, 0x7fbfffec60, 1)        = 0
semop(11862378, 0x7fbfffec30, 1)        = 0
semop(11862378, 0x7fbfffec40, 1)        = 0
semop(11862378, 0x7fbfffec50, 1)        = 0
semop(11862378, 0x7fbfffec60, 1)        = 0
semop(11862378, 0x7fbfffec30, 1)        = 0
semop(11862378, 0x7fbfffec40, 1)        = 0
semop(11862378, 0x7fbfffec50, 1)        = 0
semop(11862378, 0x7fbfffec60, 1)        = 0
semop(11862378, 0x7fbfffec30, 1)        = 0
semop(11862378, 0x7fbfffec40, 1)        = 0
semop(11862378, 0x7fbfffec50, 1)        = 0
semop(11862378, 0x7fbfffec60, 1)        = 0
semop(11862378, 0x7fbfffec30, 1)        = 0
semop(11862378, 0x7fbfffec40, 1)        = 0
semop(11862378, 0x7fbfffec50, 1)        = 0
semop(11862378, 0x7fbfffec60, 1)        = 0
semop(11862378, 0x7fbfffec30, 1)        = 0
semop(11862378, 0x7fbfffec40, 1)        = 0
semop(11862378, 0x7fbfffec50, 1)        = 0
semop(11862378, 0x7fbfffec60, 1)        = 0
semop(11862378, 0x7fbfffec30, 1)        = 0
semop(11862378, 0x7fbfffec40, 1)        = 0
semop(11862378, 0x7fbfffec50, 1)        = 0
semop(11862378, 0x7fbfffec60, 1)        = 0
semop(11862378, 0x7fbfffec30, 1)        = 0
semop(11862378, 0x7fbfffec40, 1)        = 0
semop(11862378, 0x7fbfffec50, 1)        = 0
semop(11862378, 0x7fbfffec60, 1)        = 0
semop(11862378, 0x7fbfffec30, 1)        = 0
semop(11862378, 0x7fbfffec40, 1)        = 0
semop(11862378, 0x7fbfffec50, 1)        = 0
semop(11862378, 0x7fbfffec60, 1)        = 0
semop(11862378, 0x7fbfffec30, 1)        = 0
semop(11862378, 0x7fbfffec40, 1)        = 0
semop(11862378, 0x7fbfffec50, 1)        = 0
semop(11862378, 0x7fbfffec60, 1)        = 0
semop(11862378, 0x7fbfffec30, 1)        = 0
semop(11862378, 0x7fbfffec40, 1)        = 0
semop(11862378, 0x7fbfffec50, 1)        = 0
semop(11862378, 0x7fbfffec60, 1)        = 0
semop(11862378, 0x7fbfffec30, 1)        = 0
semop(11862378, 0x7fbfffec40, 1)        = 0
semop(11862378, 0x7fbfffec50, 1)        = 0
semop(11862378, 0x7fbfffec60, 1)        = 0
semop(11862378, 0x7fbfffec30, 1)        = 0
semop(11862378, 0x7fbfffec40, 1)        = 0
semop(11862378, 0x7fbfffec50, 1)        = 0
semop(11862378, 0x7fbfffec60, 1)        = 0
semop(11862378, 0x7fbfffec30, 1)        = 0
semop(11862378, 0x7fbfffec40, 1)        = 0
semop(11862378, 0x7fbfffec50, 1)        = 0
semop(11862378, 0x7fbfffec60, 1)        = 0
semop(11862378, 0x7fbfffec30, 1)        = 0
semop(11862378, 0x7fbfffec40, 1)        = 0
semop(11862378, 0x7fbfffec50, 1)        = 0
semop(11862378, 0x7fbfffec60, 1)        = 0
semop(11862378, 0x7fbfffec30, 1)        = 0
semop(11862378, 0x7fbfffec40, 1)        = 0
semop(11862378, 0x7fbfffec50, 1)        = 0
semop(11862378, 0x7fbfffec60, 1)        = 0
semop(11862378, 0x7fbfffec30, 1)        = 0
semop(11862378, 0x7fbfffec40, 1)        = 0
semop(11862378, 0x7fbfffec50, 1)        = 0
semop(11862378, 0x7fbfffec60, 1)        = 0
semop(11862378, 0x7fbfffec30, 1)        = 0
semop(11862378, 0x7fbfffec40, 1)        = 0
semop(11862378, 0x7fbfffec50, 1)        = 0
semop(11862378, 0x7fbfffec60, 1)        = 0
semop(11862378, 0x7fbfffec30, 1)        = 0
semop(11862378, 0x7fbfffec40, 1)        = 0
semop(11862378, 0x7fbfffec50, 1)        = 0
semop(11862378, 0x7fbfffec60, 1)        = 0
semop(11862378, 0x7fbfffec30, 1)        = 0
semop(11862378, 0x7fbfffec40, 1)        = 0
semop(11862378, 0x7fbfffec50, 1)        = 0
semop(11862378, 0x7fbfffec60, 1)        = 0
semop(11862378, 0x7fbfffec30, 1)        = 0
semop(11862378, 0x7fbfffec40, 1)        = 0
semop(11862378, 0x7fbfffec50, 1)        = 0
semop(11862378, 0x7fbfffec60, 1)        = 0
semop(11862378, 0x7fbfffec30, 1)        = 0
semop(11862378, 0x7fbfffec40, 1)        = 0
semop(11862378, 0x7fbfffec50, 1)        = 0
semop(11862378, 0x7fbfffec60, 1)        = 0
semop(11862378, 0x7fbfffec30, 1)        = 0
semop(11862378, 0x7fbfffec40, 1)        = 0
semop(11862378, 0x7fbfffec50, 1)        = 0
semop(11862378, 0x7fbfffec60, 1)        = 0
semop(11862378, 0x7fbfffec30, 1)        = 0
semop(11862378, 0x7fbfffec40, 1)        = 0
semop(11862378, 0x7fbfffec50, 1)        = 0
semop(11862378, 0x7fbfffec60, 1)        = 0
semop(11862378, 0x7fbfffec30, 1)        = 0
semop(11862378, 0x7fbfffec40, 1)        = 0
semop(11862378, 0x7fbfffec50, 1)        = 0
semop(11862378, 0x7fbfffec60, 1)        = 0
semop(11862378, 0x7fbfffec30, 1)        = 0
semop(11862378, 0x7fbfffec40, 1)        = 0
semop(11862378, 0x7fbfffec50, 1)        = 0
semop(11862378, 0x7fbfffec60, 1)        = 0
semop(11862378, 0x7fbfffec30, 1)        = 0
semop(11862378, 0x7fbfffec40, 1)        = 0
semop(11862378, 0x7fbfffec50, 1)        = 0
semop(11862378, 0x7fbfffec60, 1)        = 0
semop(11862378, 0x7fbfffec30, 1)        = 0
semop(11862378, 0x7fbfffec40, 1)        = 0
semop(11862378, 0x7fbfffec50, 1)        = 0
semop(11862378, 0x7fbfffec60, 1)        = 0
semop(11862378, 0x7fbfffec30, 1)        = 0
semop(11862378, 0x7fbfffec40, 1)        = 0
semop(11862378, 0x7fbfffec50, 1)        = 0
semop(11862378, 0x7fbfffec60, 1)        = 0
semop(11862378, 0x7fbfffec30, 1)        = 0
semop(11862378, 0x7fbfffec40, 1)        = 0
semop(11862378, 0x7fbfffec50, 1)        = 0
semop(11862378, 0x7fbfffec60, 1)        = 0
semop(11862378, 0x7fbfffec30, 1)        = 0
semop(11862378, 0x7fbfffec40, 1)        = 0
semop(11862378, 0x7fbfffec50, 1)        = 0
semop(11862378, 0x7fbfffec60, 1)        = 0
semop(11862378, 0x7fbfffec30, 1)        = 0
semop(11862378, 0x7fbfffec40, 1)        = 0
semop(11862378, 0x7fbfffec50, 1)        = 0
semop(11862378, 0x7fbfffec60, 1)        = 0
semop(11862378, 0x7fbfffec30, 1)        = 0
semop(11862378, 0x7fbfffec40, 1)        = 0
semop(11862378, 0x7fbfffec50, 1)        = 0
semop(11862378, 0x7fbfffec60, 1)        = 0
semop(11862378, 0x7fbfffec30, 1)        = 0
semop(11862378, 0x7fbfffec40, 1)        = 0
semop(11862378, 0x7fbfffec50, 1)        = 0
semop(11862378, 0x7fbfffec60, 1)        = 0
semop(11862378, 0x7fbfffec30, 1)        = 0
semop(11862378, 0x7fbfffec40, 1)        = 0
semop(11862378, 0x7fbfffec50, 1)        = 0
semop(11862378, 0x7fbfffec60, 1)        = 0
semop(11862378, 0x7fbfffec30, 1)        = 0
semop(11862378, 0x7fbfffec40, 1)        = 0
semop(11862378, 0x7fbfffec50, 1)        = 0
semop(11862378, 0x7fbfffec60, 1)        = 0
semop(11862378, 0x7fbfffec30, 1)        = 0
semop(11862378, 0x7fbfffec40, 1)        = 0
semop(11862378, 0x7fbfffec50, 1)        = 0
semop(11862378, 0x7fbfffec60, 1)        = 0
semop(11862378, 0x7fbfffec30, 1)        = 0
semop(11862378, 0x7fbfffec40, 1)        = 0
semop(11862378, 0x7fbfffec50, 1)        = 0
semop(11862378, 0x7fbfffec60, 1)        = 0
semop(11862378, 0x7fbfffec30, 1)        = 0
semop(11862378, 0x7fbfffec40, 1)        = 0
semop(11862378, 0x7fbfffec50, 1)        = 0
semop(11862378, 0x7fbfffec60, 1)        = 0
semop(11862378, 0x7fbfffec30, 1)        = 0
semop(11862378, 0x7fbfffec40, 1)        = 0
semop(11862378, 0x7fbfffec50, 1)        = 0
semop(11862378, 0x7fbfffec60, 1)        = 0
semop(11862378, 0x7fbfffec30, 1)        = 0
semop(11862378, 0x7fbfffec40, 1)        = 0
semop(11862378, 0x7fbfffec50, 1)        = 0
semop(11862378, 0x7fbfffec60, 1)        = 0
semop(11862378, 0x7fbfffec30, 1)        = 0
semop(11862378, 0x7fbfffec40, 1)        = 0
semop(11862378, 0x7fbfffec50, 1)        = 0
semop(11862378, 0x7fbfffec60, 1)        = 0
semop(11862378, 0x7fbfffec30, 1)        = 0
semop(11862378, 0x7fbfffec40, 1)        = 0
semop(11862378, 0x7fbfffec50, 1)        = 0
semop(11862378, 0x7fbfffec60, 1)        = 0
semop(11862378, 0x7fbfffec30, 1)        = 0
semop(11862378, 0x7fbfffec40, 1)        = 0
semop(11862378, 0x7fbfffec50, 1)        = 0
semop(11862378, 0x7fbfffec60, 1)        = 0
semop(11862378, 0x7fbfffec30, 1)        = 0
semop(11862378, 0x7fbfffec40, 1)        = 0
semop(11862378, 0x7fbfffec50, 1)        = 0
semop(11862378, 0x7fbfffec60, 1)        = 0
semop(11862378, 0x7fbfffec30, 1)        = 0
semop(11862378, 0x7fbfffec40, 1)        = 0
semop(11862378, 0x7fbfffec50, 1)        = 0
semop(11862378, 0x7fbfffec60, 1)        = 0
semop(11862378, 0x7fbfffec30, 1)        = 0
semop(11862378, 0x7fbfffec40, 1)        = 0
semop(11862378, 0x7fbfffec50, 1)        = 0
semop(11862378, 0x7fbfffec60, 1)        = 0
semop(11862378, 0x7fbfffec30, 1)        = 0
semop(11862378, 0x7fbfffec40, 1)        = 0
semop(11862378, 0x7fbfffec50, 1)        = 0
semop(11862378, 0x7fbfffec60, 1)        = 0
semop(11862378, 0x7fbfffec30, 1)        = 0
semop(11862378, 0x7fbfffec40, 1)        = 0
semop(11862378, 0x7fbfffec50, 1)        = 0
semop(11862378, 0x7fbfffec60, 1)        = 0
semop(11862378, 0x7fbfffec30, 1)        = 0
semop(11862378, 0x7fbfffec40, 1)        = 0
semop(11862378, 0x7fbfffec50, 1)        = 0
semop(11862378, 0x7fbfffec60, 1)        = 0
semop(11862378, 0x7fbfffec30, 1)        = 0
semop(11862378, 0x7fbfffec40, 1)        = 0
semop(11862378, 0x7fbfffec50, 1)        = 0
semop(11862378, 0x7fbfffec60, 1)        = 0
semop(11862378, 0x7fbfffec30, 1)        = 0
semop(11862378, 0x7fbfffec40, 1)        = 0
semop(11862378, 0x7fbfffec50, 1)        = 0
semop(11862378, 0x7fbfffec60, 1)        = 0
semop(11862378, 0x7fbfffec30, 1)        = 0
semop(11862378, 0x7fbfffec40, 1)        = 0
semop(11862378, 0x7fbfffec50, 1)        = 0
semop(11862378, 0x7fbfffec60, 1)        = 0
semop(11862378, 0x7fbfffec30, 1)        = 0
semop(11862378, 0x7fbfffec40, 1)        = 0
semop(11862378, 0x7fbfffec50, 1)        = 0
semop(11862378, 0x7fbfffec60, 1)        = 0
semop(11862378, 0x7fbfffec30, 1)        = 0
semop(11862378, 0x7fbfffec40, 1)        = 0
semop(11862378, 0x7fbfffec50, 1)        = 0
semop(11862378, 0x7fbfffec60, 1)        = 0
semop(11862378, 0x7fbfffec30, 1)        = 0
semop(11862378, 0x7fbfffec40, 1)        = 0
semop(11862378, 0x7fbfffec50, 1)        = 0
semop(11862378, 0x7fbfffec60, 1)        = 0
semop(11862378, 0x7fbfffec30, 1)        = 0
semop(11862378, 0x7fbfffec40, 1)        = 0
semop(11862378, 0x7fbfffec50, 1)        = 0
semop(11862378, 0x7fbfffec60, 1)        = 0
semop(11862378, 0x7fbfffec30, 1)        = 0
semop(11862378, 0x7fbfffec40, 1)        = 0
semop(11862378, 0x7fbfffec50, 1)        = 0
semop(11862378, 0x7fbfffec60, 1)        = 0
semop(11862378, 0x7fbfffec30, 1)        = 0
semop(11862378, 0x7fbfffec40, 1)        = 0
semop(11862378, 0x7fbfffec50, 1)        = 0
semop(11862378, 0x7fbfffec60, 1)        = 0
semop(11862378, 0x7fbfffec30, 1)        = 0
semop(11862378, 0x7fbfffec40, 1)        = 0
semop(11862378, 0x7fbfffec50, 1)        = 0
semop(11862378, 0x7fbfffec60, 1)        = 0
semop(11862378, 0x7fbfffec30, 1)        = 0
semop(11862378, 0x7fbfffec40, 1)        = 0
semop(11862378, 0x7fbfffec50, 1)        = 0
semop(11862378, 0x7fbfffec60, 1)        = 0
semop(11862378, 0x7fbfffec30, 1)        = 0
semop(11862378, 0x7fbfffec40, 1)        = 0
semop(11862378, 0x7fbfffec50, 1)        = 0
semop(11862378, 0x7fbfffec60, 1)        = 0
semop(11862378, 0x7fbfffec30, 1)        = 0
semop(11862378, 0x7fbfffec40, 1)        = 0
semop(11862378, 0x7fbfffec50, 1)        = 0
semop(11862378, 0x7fbfffec60, 1)        = 0
semop(11862378, 0x7fbfffec30, 1)        = 0
semop(11862378, 0x7fbfffec40, 1)        = 0
semop(11862378, 0x7fbfffec50, 1)        = 0
semop(11862378, 0x7fbfffec60, 1)        = 0
semop(11862378, 0x7fbfffec30, 1)        = 0
semop(11862378, 0x7fbfffec40, 1)        = 0
semop(11862378, 0x7fbfffec50, 1)        = 0
semop(11862378, 0x7fbfffec60, 1)        = 0
semop(11862378, 0x7fbfffec30, 1)        = 0
semop(11862378, 0x7fbfffec40, 1)        = 0
semop(11862378, 0x7fbfffec50, 1)        = 0
semop(11862378, 0x7fbfffec60, 1)        = 0
semop(11862378, 0x7fbfffec30, 1)        = 0
semop(11862378, 0x7fbfffec40, 1)        = 0
semop(11862378, 0x7fbfffec50, 1)        = 0
semop(11862378, 0x7fbfffec60, 1)        = 0
semop(11862378, 0x7fbfffec30, 1)        = 0
semop(11862378, 0x7fbfffec40, 1)        = 0
semop(11862378, 0x7fbfffec50, 1)        = 0
semop(11862378, 0x7fbfffec60, 1)        = 0
semop(11862378, 0x7fbfffec30, 1)        = 0
semop(11862378, 0x7fbfffec40, 1)        = 0
semop(11862378, 0x7fbfffec50, 1)        = 0
semop(11862378, 0x7fbfffec60, 1)        = 0
semop(11862378, 0x7fbfffec30, 1)        = 0
semop(11862378, 0x7fbfffec40, 1)        = 0
semop(11862378, 0x7fbfffec50, 1)        = 0
semop(11862378, 0x7fbfffec60, 1)        = 0
semop(11862378, 0x7fbfffec30, 1)        = 0
semop(11862378, 0x7fbfffec40, 1)        = 0
semop(11862378, 0x7fbfffec50, 1)        = 0
semop(11862378, 0x7fbfffec60, 1)        = 0
semop(11862378, 0x7fbfffec30, 1)        = 0
semop(11862378, 0x7fbfffec40, 1)        = 0
semop(11862378, 0x7fbfffec50, 1)        = 0
semop(11862378, 0x7fbfffec60, 1)        = 0
semop(11862378, 0x7fbfffec30, 1)        = 0
semop(11862378, 0x7fbfffec40, 1)        = 0
semop(11862378, 0x7fbfffec50, 1)        = 0
semop(11862378, 0x7fbfffec60, 1)        = 0
semop(11862378, 0x7fbfffec30, 1)        = 0
semop(11862378, 0x7fbfffec40, 1)        = 0
semop(11862378, 0x7fbfffec50, 1)        = 0
semop(11862378, 0x7fbfffec60, 1)        = 0
semop(11862378, 0x7fbfffec30, 1)        = 0
semop(11862378, 0x7fbfffec40, 1)        = 0
semop(11862378, 0x7fbfffec50, 1)        = 0
semop(11862378, 0x7fbfffec60, 1)        = 0
semop(11862378, 0x7fbfffec30, 1)        = 0
semop(11862378, 0x7fbfffec40, 1)        = 0
semop(11862378, 0x7fbfffec50, 1)        = 0
semop(11862378, 0x7fbfffec60, 1)        = 0
semop(11862378, 0x7fbfffec30, 1)        = 0
semop(11862378, 0x7fbfffec40, 1)        = 0
semop(11862378, 0x7fbfffec50, 1)        = 0
semop(11862378, 0x7fbfffec60, 1)        = 0
semop(0, 0x7fbfffebf0, 1)               = 0
semop(0, 0x7fbfffec00, 1)               = 0
semop(1638450, 0x7fbfffeb80, 1)         = 0
semop(1638450, 0x7fbfffeb90, 1)         = 0
semop(0, 0x7fbfffebc0, 1)               = 0
semop(0, 0x7fbfffebd0, 1)               = 0
read(58, "\4\0\0\0\230\211\247\206\v\0\0\0\354\1 \2\0 \0 \300\237"...,
8192) = 8192
semop(0, 0x7fbfffebf0, 1)               = 0
semop(0, 0x7fbfffec00, 1)               = 0
semop(1638450, 0x7fbfffec00, 1)         = 0
semop(1638450, 0x7fbfffec10, 1)         = 0
semop(0, 0x7fbfffec10, 1)               = 0
semop(0, 0x7fbfffec20, 1)               = 0
semop(1638450, 0x7fbfffec30, 1)         = 0
semop(1638450, 0x7fbfffec40, 1)         = 0
semop(1638450, 0x7fbfffec50, 1)         = 0
semop(1638450, 0x7fbfffec60, 1)         = 0
semop(0, 0x7fbfffecb0, 1)               = 0
semop(0, 0x7fbfffecc0, 1)               = 0
semop(0, 0x7fbfffecd0, 1)               = 0
semop(0, 0x7fbfffece0, 1)               = 0
semop(1638450, 0x7fbfffec30, 1)         = 0
semop(1638450, 0x7fbfffec40, 1)         = 0
semop(1638450, 0x7fbfffec50, 1)         = 0
semop(1638450, 0x7fbfffec60, 1)         = 0
semop(1638450, 0x7fbfffec30, 1)         = 0
semop(1638450, 0x7fbfffec40, 1)         = 0
semop(1638450, 0x7fbfffec50, 1)         = 0
semop(1638450, 0x7fbfffec60, 1)         = 0
semop(1638450, 0x7fbfffec30, 1)         = 0
semop(1638450, 0x7fbfffec40, 1)         = 0
semop(1638450, 0x7fbfffec50, 1)         = 0


Re: Thousands of semops for every i/o

From
Tom Lane
Date:
"Jeffrey W. Baker" <jwbaker@acm.org> writes:
> This is the strace of a process which is deleting rows from four tables,
> inside a transaction, one row at a time.  There are a lot of semops for
> every i/o.  There are about 30 connections to this database currently.
> I thought deletes in a transaction just flew along in Pg, because they
> simply wrote the deleted transaction ID on the record.  It used to work
> fine in my previous locally-built 7.2 on Debian, but this is 7.2.2 on
> SuSE Enterprise Server 8.2.

The first thing that comes to mind is that the thing is using SysV
semaphores as a substitute for spinlocks.  If this is on a hardware
platform that is supposed to have TAS() support in s_lock.h or s_lock.c,
then it's a configuration or build error.  If it's on some heretofore
unknown platform, you need to write some TAS() code to get decent
performance.

One way to check is to see how many semaphores Postgres has created
("ipcs -s -a" should help here).  If it's more than approx. one per
max_connection then you're using semas for spinlocks.

            regards, tom lane

Re: Thousands of semops for every i/o

From
"Jeffrey W. Baker"
Date:
On Mon, 2003-06-09 at 23:08, Tom Lane wrote:
> "Jeffrey W. Baker" <jwbaker@acm.org> writes:
> > This is the strace of a process which is deleting rows from four tables,
> > inside a transaction, one row at a time.  There are a lot of semops for
> > every i/o.  There are about 30 connections to this database currently.
> > I thought deletes in a transaction just flew along in Pg, because they
> > simply wrote the deleted transaction ID on the record.  It used to work
> > fine in my previous locally-built 7.2 on Debian, but this is 7.2.2 on
> > SuSE Enterprise Server 8.2.
>
> The first thing that comes to mind is that the thing is using SysV
> semaphores as a substitute for spinlocks.  If this is on a hardware
> platform that is supposed to have TAS() support in s_lock.h or s_lock.c,
> then it's a configuration or build error.  If it's on some heretofore
> unknown platform, you need to write some TAS() code to get decent
> performance.

It looks like a simple change in s_lock.h from

#if defined(__i386__)

to

#if defined(__i386__) || defined(__x86_64__)

Will be necessary for this platform.

Thanks,
jwb



Re: Thousands of semops for every i/o

From
Tom Lane
Date:
"Jeffrey W. Baker" <jwbaker@acm.org> writes:
> On Mon, 2003-06-09 at 23:08, Tom Lane wrote:
>> The first thing that comes to mind is that the thing is using SysV
>> semaphores as a substitute for spinlocks.

> It looks like a simple change in s_lock.h from
> #if defined(__i386__)
> to
> #if defined(__i386__) || defined(__x86_64__)
> Will be necessary for this platform.

Cool.  I assume it still passes regression tests and so forth?

            regards, tom lane

Re: Thousands of semops for every i/o

From
Bruce Momjian
Date:
Your patch has been added to the PostgreSQL unapplied patches list at:

    http://momjian.postgresql.org/cgi-bin/pgpatches

I will try to apply it within the next 48 hours.

---------------------------------------------------------------------------


Jeffrey W. Baker wrote:
> On Mon, 2003-06-09 at 23:08, Tom Lane wrote:
> > "Jeffrey W. Baker" <jwbaker@acm.org> writes:
> > > This is the strace of a process which is deleting rows from four tables,
> > > inside a transaction, one row at a time.  There are a lot of semops for
> > > every i/o.  There are about 30 connections to this database currently.
> > > I thought deletes in a transaction just flew along in Pg, because they
> > > simply wrote the deleted transaction ID on the record.  It used to work
> > > fine in my previous locally-built 7.2 on Debian, but this is 7.2.2 on
> > > SuSE Enterprise Server 8.2.
> >
> > The first thing that comes to mind is that the thing is using SysV
> > semaphores as a substitute for spinlocks.  If this is on a hardware
> > platform that is supposed to have TAS() support in s_lock.h or s_lock.c,
> > then it's a configuration or build error.  If it's on some heretofore
> > unknown platform, you need to write some TAS() code to get decent
> > performance.
>
> It looks like a simple change in s_lock.h from
>
> #if defined(__i386__)
>
> to
>
> #if defined(__i386__) || defined(__x86_64__)
>
> Will be necessary for this platform.
>
> Thanks,
> jwb
>
>
>
> ---------------------------(end of broadcast)---------------------------
> TIP 4: Don't 'kill -9' the postmaster
>

--
  Bruce Momjian                        |  http://candle.pha.pa.us
  pgman@candle.pha.pa.us               |  (610) 359-1001
  +  If your life is a hard drive,     |  13 Roberts Road
  +  Christ can be your backup.        |  Newtown Square, Pennsylvania 19073

Re: Thousands of semops for every i/o

From
Bruce Momjian
Date:
Patch applied.  Thanks.

---------------------------------------------------------------------------


Jeffrey W. Baker wrote:
> On Mon, 2003-06-09 at 23:08, Tom Lane wrote:
> > "Jeffrey W. Baker" <jwbaker@acm.org> writes:
> > > This is the strace of a process which is deleting rows from four tables,
> > > inside a transaction, one row at a time.  There are a lot of semops for
> > > every i/o.  There are about 30 connections to this database currently.
> > > I thought deletes in a transaction just flew along in Pg, because they
> > > simply wrote the deleted transaction ID on the record.  It used to work
> > > fine in my previous locally-built 7.2 on Debian, but this is 7.2.2 on
> > > SuSE Enterprise Server 8.2.
> >
> > The first thing that comes to mind is that the thing is using SysV
> > semaphores as a substitute for spinlocks.  If this is on a hardware
> > platform that is supposed to have TAS() support in s_lock.h or s_lock.c,
> > then it's a configuration or build error.  If it's on some heretofore
> > unknown platform, you need to write some TAS() code to get decent
> > performance.
>
> It looks like a simple change in s_lock.h from
>
> #if defined(__i386__)
>
> to
>
> #if defined(__i386__) || defined(__x86_64__)
>
> Will be necessary for this platform.
>
> Thanks,
> jwb
>
>
>
> ---------------------------(end of broadcast)---------------------------
> TIP 4: Don't 'kill -9' the postmaster
>

--
  Bruce Momjian                        |  http://candle.pha.pa.us
  pgman@candle.pha.pa.us               |  (610) 359-1001
  +  If your life is a hard drive,     |  13 Roberts Road
  +  Christ can be your backup.        |  Newtown Square, Pennsylvania 19073