马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。
您需要 登录 才可以下载或查看,没有帐号?立即注册
x
曾经的功能列表可能会迅速变得过时了。而且,有些功能对有的应用程序非常重要,但是对别的应用程序则不一定。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[oracleclientpid]
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," |