Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> slow performance with opinit(OCI_EV_TSF)??

slow performance with opinit(OCI_EV_TSF)??

From: Jeff Crilly N6ZFX <jeff_at_communities.com>
Date: 1998/09/28
Message-ID: <6up8aq$q4p$1@nntp2.ba.best.com>#1/1

Newbie to OCI here...

I'm planning on building an app that has multiple threads, each with its own database connection. Right now, this is running on solaris 2.5 with oracle7.3.

I'm starting out simple: I have a small app that inserts rows in table using OCI. It does the following:

    0) opinit(OCI_EV_DEF) or opinit(OCI_EV_TSF) (see below)
    1) olog() to connect to the database,
    2) open a cursor with oopen(),
    3) does an oparse() on an insert sql statement,
    4) does obndrv() to bind three variables to the columns in the insert
stmt,

    5) iterates 30 times doing ...

        5a) set variables to a new value
        5b) calls oexec()

    6) does an ocom() to commit changes
    7) finally, an oclose() and ologoff()

When I use OCI_EV_DEF for the value to opinit() I get really good performance. It just flies. The 30 records are inserted within 1 second.

If I use opinit(OCI_EV_TSF), performace is really slow. Each oexec() takes like 1/2 second.

When I run the opinit(OCI_EV_TSF) under truss, I see the following for each oexec() call...

adding record ===============================
write(1, " a d d i n g   r e c o r".., 94)      = 94
write(8, "01  \0\006\0\0\0\0\003 G".., 288)     = 288
poll(0x00000000, 0, 100)                        = 0
poll(0x00000000, 0, 100)                        = 0
read(9, "\0 F\0\006\0\0\0\0\0\b\0".., 2048)     = 70
poll(0x00000000, 0, 100)                        = 0
poll(0x00000000, 0, 100)                        = 0
adding record ===============================
write(1, " a d d i n g   r e c o r".., 95)      = 95
write(8, "\0 @\0\006\0\0\0\0\00304".., 64)      = 64
poll(0x00000000, 0, 100)                        = 0
poll(0x00000000, 0, 100)                        = 0
read(9, "\0 ;\0\006\0\0\0\0\004\0".., 2048)     = 59
poll(0x00000000, 0, 100)                        = 0
poll(0x00000000, 0, 100)                        = 0

Apparantly, its doing these two poll()s for each read or write with a timeout of 1/10 second. Hence, I'm seeing this slowdown. Also, the params to poll() seem bogus.

Any idea how to fix this?

jeff Received on Mon Sep 28 1998 - 00:00:00 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US