Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

N single thread processes having better perf than 1 process N threads

Status
Not open for further replies.

nshen

Programmer
May 14, 2002
53
US
Hi! I have an OCI application that makes one OCIEnvCreate call with OCI_THREADED attribute at main then creates N threads as needed; each thread with its own OCIServerAttach and OCISessionBegin.
We observed an interesting result when testing it using a wide stored procedure (with more than 450 I/O parameters). Both the response time and throughput of running 4 instances of this application as single thread app is better than running 1 instance of this app with 4 threads. We checked the server side there was no difference in the execution time. So it would seem to be a contention in the client side. Are there any parameter that I need to tune for multi-threaded OCI application at the Oracle client level?

We have tried both 8.1.7.4 and 9.2.0.3 clients on Widnwos and on Solaris.
Thank you!
Regards, Nancy
 
What sort of performance difference are we talking about-- 5% or 50%?

In general, since OCI would have to have some sort of locking or synchronization on the environment's data structures, I'd expect that N threads would behave slightly worse than N processes, but that it wouldn't be a significant difference (i.e. a few percent).

Is there anything in your code that could be causing additional locking?

Justin
 
It is below 10%: 7- 8%.
I was wondering that since each of my "thread" has its own OCIServerAttch/OCISessionBegin, will the OCI_THREADED attibute setting in the OCIEnvCreate actually hurt the multithreaded application.
Thanks In Advance!
Regards, Nancy
 
I believe that the OCI_THREADED attribute is required in this situation (but someone taking a detailed look at the OCI Programmer's Reference on might well prove this belief wrong).

I would generally think that a 7-8% performance loss would be about right for 4 threads contending for data structures in the OCI Environment object.

Justin
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top