blob: 6a5c474ce76b758a60d118262e97c8e7ff1a3564 [file] [log] [blame]
(window.webpackJsonp=window.webpackJsonp||[]).push([[51],{615:function(e,t,i){"use strict";i.r(t);var s=i(68),r=Object(s.a)({},(function(){var e=this,t=e.$createElement,i=e._self._c||t;return i("ContentSlotsDistributor",{attrs:{"slot-key":e.$parent.slotKey}},[i("h1",{attrs:{id:"wal"}},[i("a",{staticClass:"header-anchor",attrs:{href:"#wal"}},[e._v("#")]),e._v(" WAL")]),e._v(" "),i("h2",{attrs:{id:"work-process"}},[i("a",{staticClass:"header-anchor",attrs:{href:"#work-process"}},[e._v("#")]),e._v(" Work Process")]),e._v(" "),i("ul",[i("li",[e._v("WAL overall recording principle\n"),i("ul",[i("li",[e._v("For each Memtable, a corresponding WAL file will be recorded. When the Memtable is flushed, the WAL will be deleted.")])])]),e._v(" "),i("li",[e._v("WAL record details\n"),i("ul",[i("li",[e._v("The test workload is 1sg,1device,100sensor,1,000,000 points each sensor,force_wal_period_in_ms=10")]),e._v(" "),i("li",[e._v("In org.apache.iotdb.db.writelog.node.ExclusiveWriteLogNode, the WAL buffer size will be allocated according to the wal_buffer_size in the configuration. If the buffer size is exceeded during the process of putting WAL, it will be flushed to disk")]),e._v(" "),i("li",[e._v("In org.apache.iotdb.db.writelog.manager, nodeMap will continue to accumulate WAL")]),e._v(" "),i("li",[e._v("WAL has two ways to be flashed to disk (enable at the same time)\n"),i("ul",[i("li",[e._v("Each time a record is written in org.apache.iotdb.db.writelog.node.ExclusiveWriteLogNode, it will be judged whether the accumulated WAL size of the current node exceeds the flush_wal_threshold in the configuration. If it exceeds, it will be flushed to the disk.")]),e._v(" "),i("li",[e._v("When org.apache.iotdb.db.writelog.manager.MultiFileLogNodeManager starts, a timing thread will be generated, and the nodeMap in the memory will be flushed to the disk according to the force_wal_period_in_ms timing call thread. The calling example is as follows\n"),i("ul",[i("li",[e._v("Persistence(forceTask)-sleep({force_wal_period_in_ms})-Persistence(forceTask)-sleep({force_wal_period_in_ms})")])])])])])])])]),e._v(" "),i("h2",{attrs:{id:"test-result"}},[i("a",{staticClass:"header-anchor",attrs:{href:"#test-result"}},[e._v("#")]),e._v(" Test Result")]),e._v(" "),i("ul",[i("li",[e._v("When running forceTask, The entire process is mainly blocked by org.apache.iotdb.db.writelog.io.LogWriter.force()")]),e._v(" "),i("li",[e._v("Test forceTask on SSD and HDD respectively\n"),i("ul",[i("li",[e._v("In SSD, the speed is 75MB/s")]),e._v(" "),i("li",[e._v("In HDD, the speed is 5MB/s")]),e._v(" "),i("li",[e._v("So when in HDD, users must pay attention to adjustment force_wal_period_in_ms and let it not to be too small, otherwise it will seriously reduce write performance\n"),i("ul",[i("li",[e._v("After testing, the optimal parameter configuration in HDD is 100ms-200ms, and the test results are as follows\n"),i("img",{staticStyle:{width:"100%","max-width":"800px","max-height":"600px","margin-left":"auto","margin-right":"auto",display:"block"},attrs:{src:"https://user-images.githubusercontent.com/24886743/93157479-e3319f80-f73c-11ea-836f-459d03cb2fab.png"}})])])])])])]),e._v(" "),i("h2",{attrs:{id:"related-code"}},[i("a",{staticClass:"header-anchor",attrs:{href:"#related-code"}},[e._v("#")]),e._v(" Related Code")]),e._v(" "),i("ul",[i("li",[e._v("org.apache.iotdb.db.writelog.*")])])])}),[],!1,null,null,null);t.default=r.exports}}]);