MYSQL网页设计怎样加速ORACLE当地OCI的挪用速率
曾经的功能列表可能会迅速变得过时了。而且,有些功能对有的应用程序非常重要,但是对别的应用程序则不一定。oracle|速率此文摘自developers.sun.com写的很杰出,我本人试用了一下,功能公然有所进步developers.sun.com
TechnicalArticles&TipsCacheOCICallstoImprovePerformanceof32-Bitor64-BitOracleClients
ByNagendraNagarajayya,October2003E-mailPrintablePageDownloadendcommenttag-->Contents:IntroductionIdentifyingtheProblemTheWorkaround:Cacheoraus.msbinMemoryBuildingcache_oraus.soHowtoUsecache_oraus.soHowtheCachingWorks
6.1Interpositionoftheopen()FunctionCall
6.2Interpositionofthefcntl()FunctionCall
6.3Interpositionofthelseek(),read(),andclose()FunctionCallsPerformanceImprovement
7.1WithoutLD_PRELOADandcache_oraus.so
7.2WithLD_PRELOADandcache_oraus.so
CaveatConclusionAcknowledgmentsReferences
A.Appendix:TestProgramsandWrappers
A1.README
A2.cache_oraus.c
A3.test.c
A4.test.sh
A5.test1.sh
A6.test_v.c
A7.test_v.sh
A8.c.sh
A9.c64.sh
A10.Cache_open_calls.c
1.Introduction
IfyouworkwithOracleclientsthatmakeuseofOCI(OracleCallInterface),youmayhavenoticedthattheOCIdriverin8.1.7.xmakesthousandsofcallstotranslatemessagesfromtheoraus.msbfile.Thiscandegradeapplicationperformanceby5percentormore(quiteseverelyinsomecases).ThisproblemhasbeendocumentedbyOracleunderbugID2142623.
Theproblemcanbeovercomebycachingtheoraus.msbfileinmemory,andtranslatingthefileaccessandsystemcallstousercallsandmemoryoperations.Thecachingsolutionisdynamic,andcodechangesarenotneeded.ThesolutioncanimprovetheperformanceoftheOracleclientapplication.Recently,thissolutionresultedinbringingdowntheapplicationruntimefrom15minutestoafewsecondsatamajorcustomer–about100xtimesperformanceimprovement.
TheperformancebenefitscanbeseeninapplicationslikesqlplusandOracleclients(CandC++)makinguseoftheOCIdriver.Javatechnology-basedapplicationsusingJDBC(nativedriver)shouldalsoseesimilarbenefits.
2.IdentifyingtheProblem
AnOracleclientapplicationcanbetrussedontheSolarisOperatingSystem(OS)toseethecallsbeingmadetothisfile--"truss"isasystemutilityavailableontheSolarisplatform,anditcanbeusedtotracesystemcallsmadebyanapplication.ArunningOracleclientapplicationcanbetrussedasfollows:
truss-p
Thetrusscommandwillshowallthesystemcallsbeingmadebytheapplication.Theonesofinterestaretheopen(),fcntl(),lseek(),read(),andclose()calls.ThesecallsaremadebytheOCIdriverrepeatedlytotranslatemessages.Hereisatrusssnippetshowingtheproblemcalls:
open("/oracle/app/oracle/product/8.1.7/rdbms/mesg/oraus.msb",O_RDONLY)=9fcntl(9,F_SETFD,0x00000001)=0lseek(9,0,SEEK_SET)=0read(9,"1513"011303 "..,256)=256lseek(9,512,SEEK_SET)=512read(9,"1C88Yr~M "..,512)=512lseek(9,1024,SEEK_SET)=1024read(9,"