asmuts 02/01/20 08:08:08 Added: docs/jcs LateralTCPAuxiliaryCache.html Log: some initial documentation Revision Changes Path 1.1 jakarta-turbine-stratum/docs/jcs/LateralTCPAuxiliaryCache.html Index: LateralTCPAuxiliaryCache.html =================================================================== <html xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns="http://www.w3.org/TR/REC-html40"> <head> <meta http-equiv=Content-Type content="text/html; charset=windows-1252"> <meta name=ProgId content=Word.Document> <meta name=Generator content="Microsoft Word 10"> <meta name=Originator content="Microsoft Word 10"> <link rel=File-List href="LateralTCPAuxiliaryCache_files/filelist.xml"> <title>Lateral TCP Auxiliary Cache</title> <!--[if gte mso 9]><xml> <o:DocumentProperties> <o:Author>Aaron Smuts</o:Author> <o:LastAuthor>Aaron Smuts</o:LastAuthor> <o:Revision>3</o:Revision> <o:TotalTime>49</o:TotalTime> <o:Created>2002-01-20T06:12:00Z</o:Created> <o:LastSaved>2002-01-20T16:10:00Z</o:LastSaved> <o:Pages>1</o:Pages> <o:Words>575</o:Words> <o:Characters>3278</o:Characters> <o:Company>therealm</o:Company> <o:Lines>27</o:Lines> <o:Paragraphs>7</o:Paragraphs> <o:CharactersWithSpaces>3846</o:CharactersWithSpaces> <o:Version>10.2625</o:Version> </o:DocumentProperties> </xml><![endif]--><!--[if gte mso 9]><xml> <w:WordDocument> <w:SpellingState>Clean</w:SpellingState> <w:GrammarState>Clean</w:GrammarState> <w:BrowserLevel>MicrosoftInternetExplorer4</w:BrowserLevel> </w:WordDocument> </xml><![endif]--> <style> <!-- /* Style Definitions */ p.MsoNormal, li.MsoNormal, div.MsoNormal {mso-style-parent:""; margin:0in; margin-bottom:.0001pt; mso-pagination:widow-orphan; font-size:12.0pt; font-family:"Times New Roman"; mso-fareast-font-family:"Times New Roman";} span.SpellE {mso-style-name:""; mso-spl-e:yes;} span.GramE {mso-style-name:""; mso-gram-e:yes;} @page Section1 {size:8.5in 11.0in; margin:1.0in 1.25in 1.0in 1.25in; mso-header-margin:.5in; mso-footer-margin:.5in; mso-paper-source:0;} div.Section1 {page:Section1;} --> </style> <!--[if gte mso 10]> <style> /* Style Definitions */ table.MsoNormalTable {mso-style-name:"Table Normal"; mso-tstyle-rowband-size:0; mso-tstyle-colband-size:0; mso-style-noshow:yes; mso-style-parent:""; mso-padding-alt:0in 5.4pt 0in 5.4pt; mso-para-margin:0in; mso-para-margin-bottom:.0001pt; mso-pagination:widow-orphan; font-size:10.0pt; font-family:"Times New Roman";} </style> <![endif]--> </head> <body lang=EN-US style='tab-interval:.5in'> <div class=Section1> <p class=MsoNormal align=center style='text-align:center'><b style='mso-bidi-font-weight: normal'>Lateral TCP Auxiliary Cache<o:p></o:p></b></p> <p class=MsoNormal align=center style='text-align:center'><b style='mso-bidi-font-weight: normal'><o:p> </o:p></b></p> <p class=MsoNormal align=center style='text-align:center'><b style='mso-bidi-font-weight: normal'><o:p> </o:p></b></p> <p class=MsoNormal><b style='mso-bidi-font-weight:normal'>Description<o:p></o:p></b></p> <p class=MsoNormal>The TCP Lateral Auxiliary Cache is an optional plug in for the JCS.<span style='mso-spacerun:yes'>�� </span>It is primarily intended to broadcast puts and removals to other local caches, though it can also get cached objects.<span style='mso-spacerun:yes'>� </span>It functions by opening up a <span class=SpellE>SocketServer</span> that listens to a configurable port and by creating Socket connections with other local cache <span class=SpellE>SocketServers</span>.<span style='mso-spacerun:yes'>� </span>It can be configured to connect to any number of servers.<span style='mso-spacerun:yes'>� </span></p> <p class=MsoNormal><o:p> </o:p></p> <p class=MsoNormal>If there is an error connecting to another server or if an error occurs in transmission, it will move into a recovery mode.<span style='mso-spacerun:yes'>� </span>In recovery mode the TCP Lateral Auxiliary Cache will continue to communicate with healthy servers while it tries to restore the connection with the server that is in error.</p> <p class=MsoNormal><o:p> </o:p></p> <p class=MsoNormal>The cache hub communicates with a fa�ade that implements a zombie pattern (balking fa�ade) to prevent blocking.<span style='mso-spacerun:yes'>� </span>Puts and removals are queued and occur synchronously in the background.<span style='mso-spacerun:yes'>� </span>Get requests are synchronous and can potentially block for a configurable interval if there is a communication problem.</p> <p class=MsoNormal><b style='mso-bidi-font-weight:normal'><o:p> </o:p></b></p> <p class=MsoNormal><b style='mso-bidi-font-weight:normal'>Configuration<o:p></o:p></b></p> <p class=MsoNormal>The configuration is fairly straightforward and is done in the auxiliary cache section of the <span class=SpellE>cache.ccf</span> configuration file.<span style='mso-spacerun:yes'>� </span>In the example below, I created a TCP Lateral Auxiliary Cache referenced by "LTCP".<span style='mso-spacerun:yes'>� </span>It connects to two servers defined in a comma separated list in the "<span class=SpellE>TcpServers</span>" attribute.<span style='mso-spacerun:yes'>� </span>It listens to port "1110" and does not run in "<span class=SpellE>PutOnlyMode</span>".<span style='mso-spacerun:yes'>� </span>Setting "<span class=SpellE>PutOnlyMode</span>" equal to "true" would cause the auxiliary cache to return null from any get request.<span style='mso-spacerun:yes'>� </span>In most cases this attribute should be set to "true", since if the lateral caches were properly configured, the elements in one would be present in all.</p> <p class=MsoNormal><o:p> </o:p></p> <p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>jcs.auxiliary.LTCP=org.apache.stratum.jcs.auxiliary.lateral.LateralCacheFactory<o:p></o:p></span></p> <p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>jcs.auxiliary.LTCP.attributes=org.apache.stratum.jcs.auxiliary.lateral.LateralCacheAttributes<o:p></o:p></span></p> <p class=MsoNormal style='margin-left:.5in'><span class=SpellE><span style='font-size:10.0pt'>jcs.auxiliary.LTCP.attributes.TransmissionTypeName</span></span><span style='font-size:10.0pt'>=TCP<o:p></o:p></span></p> <p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>jcs.auxiliary.LTCP.attributes.TcpServers=localhost<span class=GramE>:1111,localhost:1112</span><o:p></o:p></span></p> <p class=MsoNormal style='margin-left:.5in'><span class=SpellE><span style='font-size:10.0pt'>jcs.auxiliary.LTCP.attributes.TcpListenerPort</span></span><span style='font-size:10.0pt'>=1110<o:p></o:p></span></p> <p class=MsoNormal style='margin-left:.5in'><span class=SpellE><span style='font-size:10.0pt'>jcs.auxiliary.LTCP.attributes.PutOnlyMode</span></span><span style='font-size:10.0pt'>=false<o:p></o:p></span></p> <p class=MsoNormal align=center style='text-align:center'><b style='mso-bidi-font-weight: normal'><o:p> </o:p></b></p> <p class=MsoNormal><b style='mso-bidi-font-weight:normal'>Potential Issues<o:p></o:p></b></p> <p class=MsoNormal>The TCP Lateral Auxiliary Cache can provide a high level of consistency but it does not guarantee consistency between caches.<span style='mso-spacerun:yes'>� </span>A put for the same object could be issued in two different local caches. Since the transmission is queued, a situation could occur where the item put last in one cache is overridden by a put request from another local cache.<span style='mso-spacerun:yes'>� </span>The two local caches could potentially have different versions of the same item.<span style='mso-spacerun:yes'>� </span>Like most caches, this is intended for high get and low put utilization, and this occurrence would hint at improper usage.<span style='mso-spacerun:yes'>� </span>The RMI Remote cache makes this situation a bit less likely to occur, since the default behavior is to remove local copies on put operations.<span style='mso-spacerun:yes'>� </span>If either local cache needed the item put in the above situation, it would have to go remote to retrieve it.<span style='mso-spacerun:yes'>� </span>Both local copies would have been expired and would end up using the same version, though it is possible that the version stored remotely would not be the last version created.<span style='mso-spacerun:yes'>� </span>The OCS4J tries to implement a locking system to prevent this from occurring, but the locking system itself could suffer from similar problems (when granting locks from two roughly simultaneous lock requests) and it would create a significant burden on all the caches involved.<span style='mso-spacerun:yes'>� </span>Since this situation would be extremely rare and is nearly impossible to solve practically, for now JCS will not offer any type of locking.</p> <p class=MsoNormal><b style='mso-bidi-font-weight:normal'><o:p> </o:p></b></p> <p class=MsoNormal><b style='mso-bidi-font-weight:normal'>TODO<o:p></o:p></b></p> <p class=MsoNormal>I will be adding a "<span class=SpellE>RemoveOnPut</span>" attribute that will cause the lateral cache to remove an element from the cache rather than inserting it when a put command comes from another lateral cache.<span style='mso-spacerun:yes'>� </span>This will allow the local caches to dictate their own memory usage pattern. <span style='mso-spacerun:yes'>�</span>This setting should be run with "<span class=SpellE>PutOnlyMode</span>" set to false.<o:p></o:p></p> </div> </body> </html>
-- To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]> For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>
