| "use strict";(self.webpackChunk=self.webpackChunk||[]).push([[8507],{28453:(e,n,i)=>{i.d(n,{R:()=>d,x:()=>c});var t=i(96540);const r={},s=t.createContext(r);function d(e){const n=t.useContext(s);return t.useMemo((function(){return"function"==typeof e?e(n):{...n,...e}}),[n,e])}function c(e){let n;return n=e.disableParentContext?"function"==typeof e.components?e.components(r):e.components||r:d(e.components),t.createElement(s.Provider,{value:n},e.children)}},70590:(e,n,i)=>{i.r(n),i.d(n,{assets:()=>a,contentTitle:()=>c,default:()=>o,frontMatter:()=>d,metadata:()=>t,toc:()=>l});const t=JSON.parse('{"id":"configuration/human-readable-byte","title":"Human-readable Byte Configuration Reference","description":"\x3c!--","source":"@site/docs/32.0.0/configuration/human-readable-byte.md","sourceDirName":"configuration","slug":"/configuration/human-readable-byte","permalink":"/docs/32.0.0/configuration/human-readable-byte","draft":false,"unlisted":false,"tags":[],"version":"current","frontMatter":{"id":"human-readable-byte","title":"Human-readable Byte Configuration Reference"}}');var r=i(74848),s=i(28453);const d={id:"human-readable-byte",title:"Human-readable Byte Configuration Reference"},c=void 0,a={},l=[{value:"A number in bytes",id:"a-number-in-bytes",level:2},{value:"A number with a unit suffix",id:"a-number-with-a-unit-suffix",level:2},{value:"Supported Units",id:"supported-units",level:3}];function h(e){const n={a:"a",code:"code",h2:"h2",h3:"h3",li:"li",ol:"ol",p:"p",pre:"pre",table:"table",tbody:"tbody",td:"td",th:"th",thead:"thead",tr:"tr",...(0,s.R)(),...e.components};return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(n.p,{children:"This page documents configuration properties related to bytes."}),"\n",(0,r.jsx)(n.p,{children:"These properties can be configured through 2 ways:"}),"\n",(0,r.jsxs)(n.ol,{children:["\n",(0,r.jsx)(n.li,{children:"a simple number in bytes"}),"\n",(0,r.jsx)(n.li,{children:"a number with a unit suffix"}),"\n"]}),"\n",(0,r.jsx)(n.h2,{id:"a-number-in-bytes",children:"A number in bytes"}),"\n",(0,r.jsx)(n.p,{children:"Given that cache size is 3G, there's a configuration as below"}),"\n",(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-properties",children:"# 3G bytes = 3_000_000_000 bytes\ndruid.cache.sizeInBytes=3000000000 \n"})}),"\n",(0,r.jsx)(n.h2,{id:"a-number-with-a-unit-suffix",children:"A number with a unit suffix"}),"\n",(0,r.jsx)(n.p,{children:"When you have to put a large number for some configuration as above, it is easy to make a mistake such as extra or missing 0s. Druid supports a better way, a number with a unit suffix."}),"\n",(0,r.jsx)(n.p,{children:"Given a disk of 1T, the configuration can be"}),"\n",(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-properties",children:'druid.segmentCache.locations=[{"path":"/segment-cache-00","maxSize":"1t"},{"path":"/segment-cache-01","maxSize":"1200g"}]\n'})}),"\n",(0,r.jsxs)(n.p,{children:["Note: in above example, both ",(0,r.jsx)(n.code,{children:"1t"})," and ",(0,r.jsx)(n.code,{children:"1T"})," are acceptable since it's case-insensitive.\nAlso, only integers are valid as the number part. For example, you can't replace ",(0,r.jsx)(n.code,{children:"1200g"})," with ",(0,r.jsx)(n.code,{children:"1.2t"}),"."]}),"\n",(0,r.jsx)(n.h3,{id:"supported-units",children:"Supported Units"}),"\n",(0,r.jsxs)(n.p,{children:["In the world of computer, a unit like ",(0,r.jsx)(n.code,{children:"K"})," is ambiguous. It means 1000 or 1024 in different contexts, for more information please see ",(0,r.jsx)(n.a,{href:"https://en.wikipedia.org/wiki/Binary_prefix",children:"Here"}),"."]}),"\n",(0,r.jsx)(n.p,{children:"To make it clear, the base of units are defined in Druid as below"}),"\n",(0,r.jsxs)(n.table,{children:[(0,r.jsx)(n.thead,{children:(0,r.jsxs)(n.tr,{children:[(0,r.jsx)(n.th,{children:"Unit"}),(0,r.jsx)(n.th,{children:"Description"}),(0,r.jsx)(n.th,{children:"Base"})]})}),(0,r.jsxs)(n.tbody,{children:[(0,r.jsxs)(n.tr,{children:[(0,r.jsx)(n.td,{children:"K"}),(0,r.jsx)(n.td,{children:"Kilo Decimal Byte"}),(0,r.jsx)(n.td,{children:"1_000"})]}),(0,r.jsxs)(n.tr,{children:[(0,r.jsx)(n.td,{children:"M"}),(0,r.jsx)(n.td,{children:"Mega Decimal Byte"}),(0,r.jsx)(n.td,{children:"1_000_000"})]}),(0,r.jsxs)(n.tr,{children:[(0,r.jsx)(n.td,{children:"G"}),(0,r.jsx)(n.td,{children:"Giga Decimal Byte"}),(0,r.jsx)(n.td,{children:"1_000_000_000"})]}),(0,r.jsxs)(n.tr,{children:[(0,r.jsx)(n.td,{children:"T"}),(0,r.jsx)(n.td,{children:"Tera Decimal Byte"}),(0,r.jsx)(n.td,{children:"1_000_000_000_000"})]}),(0,r.jsxs)(n.tr,{children:[(0,r.jsx)(n.td,{children:"P"}),(0,r.jsx)(n.td,{children:"Peta Decimal Byte"}),(0,r.jsx)(n.td,{children:"1_000_000_000_000_000"})]}),(0,r.jsxs)(n.tr,{children:[(0,r.jsx)(n.td,{children:"Ki"}),(0,r.jsx)(n.td,{children:"Kilo Binary Byte"}),(0,r.jsx)(n.td,{children:"1024"})]}),(0,r.jsxs)(n.tr,{children:[(0,r.jsx)(n.td,{children:"Mi"}),(0,r.jsx)(n.td,{children:"Mega Binary Byte"}),(0,r.jsx)(n.td,{children:"1024 * 1024"})]}),(0,r.jsxs)(n.tr,{children:[(0,r.jsx)(n.td,{children:"Gi"}),(0,r.jsx)(n.td,{children:"Giga Binary Byte"}),(0,r.jsx)(n.td,{children:"1024 * 1024 * 1024"})]}),(0,r.jsxs)(n.tr,{children:[(0,r.jsx)(n.td,{children:"Ti"}),(0,r.jsx)(n.td,{children:"Tera Binary Byte"}),(0,r.jsx)(n.td,{children:"1024 * 1024 * 1024 * 1024"})]}),(0,r.jsxs)(n.tr,{children:[(0,r.jsx)(n.td,{children:"Pi"}),(0,r.jsx)(n.td,{children:"Peta Binary Byte"}),(0,r.jsx)(n.td,{children:"1024 * 1024 * 1024 * 1024 * 1024"})]}),(0,r.jsxs)(n.tr,{children:[(0,r.jsx)(n.td,{children:"KiB"}),(0,r.jsx)(n.td,{children:"Kilo Binary Byte"}),(0,r.jsx)(n.td,{children:"1024"})]}),(0,r.jsxs)(n.tr,{children:[(0,r.jsx)(n.td,{children:"MiB"}),(0,r.jsx)(n.td,{children:"Mega Binary Byte"}),(0,r.jsx)(n.td,{children:"1024 * 1024"})]}),(0,r.jsxs)(n.tr,{children:[(0,r.jsx)(n.td,{children:"GiB"}),(0,r.jsx)(n.td,{children:"Giga Binary Byte"}),(0,r.jsx)(n.td,{children:"1024 * 1024 * 1024"})]}),(0,r.jsxs)(n.tr,{children:[(0,r.jsx)(n.td,{children:"TiB"}),(0,r.jsx)(n.td,{children:"Tera Binary Byte"}),(0,r.jsx)(n.td,{children:"1024 * 1024 * 1024 * 1024"})]}),(0,r.jsxs)(n.tr,{children:[(0,r.jsx)(n.td,{children:"PiB"}),(0,r.jsx)(n.td,{children:"Peta Binary Byte"}),(0,r.jsx)(n.td,{children:"1024 * 1024 * 1024 * 1024 * 1024"})]})]})]}),"\n",(0,r.jsxs)(n.p,{children:["Unit is case-insensitive. ",(0,r.jsx)(n.code,{children:"k"}),", ",(0,r.jsx)(n.code,{children:"kib"}),", ",(0,r.jsx)(n.code,{children:"ki"}),", ",(0,r.jsx)(n.code,{children:"KiB"}),", ",(0,r.jsx)(n.code,{children:"Ki"}),", ",(0,r.jsx)(n.code,{children:"kiB"})," are all acceptable."]}),"\n",(0,r.jsx)(n.p,{children:"Here are some examples"}),"\n",(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-properties",children:"# 1G bytes = 1_000_000_000 bytes\ndruid.cache.sizeInBytes=1g \n"})}),"\n",(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-properties",children:"# 256MiB bytes = 256 * 1024 * 1024 bytes\ndruid.cache.sizeInBytes=256MiB \n"})}),"\n",(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-properties",children:"# 256Mi = 256MiB = 256 * 1024 * 1024 bytes\ndruid.cache.sizeInBytes=256Mi\n"})})]})}function o(e={}){const{wrapper:n}={...(0,s.R)(),...e.components};return n?(0,r.jsx)(n,{...e,children:(0,r.jsx)(h,{...e})}):h(e)}}}]); |