mirror of
https://github.com/openziti/zrok.git
synced 2024-12-23 15:18:52 +01:00
1 line
8.7 KiB
JavaScript
1 line
8.7 KiB
JavaScript
"use strict";(self.webpackChunkwebsite=self.webpackChunkwebsite||[]).push([[900],{169:(e,i,n)=>{n.r(i),n.d(i,{assets:()=>a,contentTitle:()=>o,default:()=>d,frontMatter:()=>r,metadata:()=>l,toc:()=>c});var t=n(5893),s=n(1151);const r={sidebar_position:40},o="Configuring Limits",l={id:"guides/self-hosting/metrics-and-limits/configuring-limits",title:"Configuring Limits",description:"If you have not yet configured metrics, please visit the metrics guide first before working through the limits configuration.",source:"@site/../docs/guides/self-hosting/metrics-and-limits/configuring-limits.md",sourceDirName:"guides/self-hosting/metrics-and-limits",slug:"/guides/self-hosting/metrics-and-limits/configuring-limits",permalink:"/docs/guides/self-hosting/metrics-and-limits/configuring-limits",draft:!1,unlisted:!1,editUrl:"https://github.com/openziti/zrok/blob/main/docs/../docs/guides/self-hosting/metrics-and-limits/configuring-limits.md",tags:[],version:"current",sidebarPosition:40,frontMatter:{sidebar_position:40},sidebar:"tutorialSidebar",previous:{title:"Configuring Metrics",permalink:"/docs/guides/self-hosting/metrics-and-limits/configuring-metrics"},next:{title:"OAuth",permalink:"/docs/category/oauth"}},a={},c=[{value:"The Global Controls",id:"the-global-controls",level:2},{value:"Resource Limits",id:"resource-limits",level:2},{value:"Bandwidth Limits",id:"bandwidth-limits",level:2},{value:"Limit Actions",id:"limit-actions",level:3},{value:"Unlimited Accounts",id:"unlimited-accounts",level:2}];function h(e){const i={a:"a",blockquote:"blockquote",code:"code",em:"em",h1:"h1",h2:"h2",h3:"h3",p:"p",pre:"pre",...(0,s.a)(),...e.components};return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(i.h1,{id:"configuring-limits",children:"Configuring Limits"}),"\n",(0,t.jsxs)(i.blockquote,{children:["\n",(0,t.jsxs)(i.p,{children:["If you have not yet configured ",(0,t.jsx)(i.a,{href:"/docs/guides/self-hosting/metrics-and-limits/configuring-metrics",children:"metrics"}),", please visit the ",(0,t.jsx)(i.a,{href:"/docs/guides/self-hosting/metrics-and-limits/configuring-metrics",children:"metrics guide"})," first before working through the limits configuration."]}),"\n"]}),"\n",(0,t.jsxs)(i.p,{children:["The limits facility in ",(0,t.jsx)(i.code,{children:"zrok"})," is responsible for controlling the number of resources in use (environments, shares) and also for ensuring that any single account, environment, or share is held below the configured thresholds."]}),"\n",(0,t.jsxs)(i.p,{children:["Take this ",(0,t.jsx)(i.code,{children:"zrok"})," controller configuration stanza as an example:"]}),"\n",(0,t.jsx)(i.pre,{children:(0,t.jsx)(i.code,{className:"language-yaml",children:"limits:\n enforcing: true\n cycle: 1m\n environments: -1\n shares: -1\n bandwidth:\n per_account:\n period: 5m\n warning:\n rx: -1\n tx: -1\n total: 7242880\n limit:\n rx: -1\n tx: -1\n total: 10485760\n per_environment:\n period: 5m\n warning:\n rx: -1\n tx: -1\n total: -1\n limit:\n rx: -1\n tx: -1\n total: -1\n per_share:\n period: 5m\n warning:\n rx: -1\n tx: -1\n total: -1\n limit:\n rx: -1\n tx: -1\n total: -1\n"})}),"\n",(0,t.jsx)(i.h2,{id:"the-global-controls",children:"The Global Controls"}),"\n",(0,t.jsxs)(i.p,{children:["The ",(0,t.jsx)(i.code,{children:"enforcing"})," boolean will globally enable or disable limits for the controller."]}),"\n",(0,t.jsxs)(i.p,{children:["The ",(0,t.jsx)(i.code,{children:"cycle"})," value controls how frequently the limits system will look for limited resources to re-enable."]}),"\n",(0,t.jsx)(i.h2,{id:"resource-limits",children:"Resource Limits"}),"\n",(0,t.jsxs)(i.p,{children:["The ",(0,t.jsx)(i.code,{children:"environments"})," and ",(0,t.jsx)(i.code,{children:"shares"})," values control the number of environments and shares that are allowed per-account. Any limit value can be set to ",(0,t.jsx)(i.code,{children:"-1"}),", which means ",(0,t.jsx)(i.em,{children:"unlimited"}),"."]}),"\n",(0,t.jsx)(i.h2,{id:"bandwidth-limits",children:"Bandwidth Limits"}),"\n",(0,t.jsxs)(i.p,{children:["The ",(0,t.jsx)(i.code,{children:"bandwidth"})," section is designed to provide a configurable system for controlling the amount of data transfer that can be performed by users of the ",(0,t.jsx)(i.code,{children:"zrok"})," service instance. The bandwidth limits are configurable for each share, environment, and account."]}),"\n",(0,t.jsxs)(i.p,{children:[(0,t.jsx)(i.code,{children:"per_account"}),", ",(0,t.jsx)(i.code,{children:"per_environment"}),", and ",(0,t.jsx)(i.code,{children:"per_share"})," are all configured the same way:"]}),"\n",(0,t.jsxs)(i.p,{children:["The ",(0,t.jsx)(i.code,{children:"period"})," specifies the time window for the bandwidth limit. See the documentation for ",(0,t.jsx)(i.a,{href:"https://pkg.go.dev/time#ParseDuration",children:(0,t.jsx)(i.code,{children:"time.Duration.ParseDuration"})})," for details about the format used for these durations. If the ",(0,t.jsx)(i.code,{children:"period"})," is set to 5 minutes, then the limits implementation will monitor the send and receive traffic for the resource (share, environment, or account) for the last 5 minutes, and if the amount of data is greater than either the ",(0,t.jsx)(i.code,{children:"warning"})," or the ",(0,t.jsx)(i.code,{children:"limit"})," threshold, action will be taken."]}),"\n",(0,t.jsxs)(i.p,{children:["The ",(0,t.jsx)(i.code,{children:"rx"})," value is the number of bytes ",(0,t.jsx)(i.em,{children:"received"})," by the resource. The ",(0,t.jsx)(i.code,{children:"tx"})," value is the number of bytes ",(0,t.jsx)(i.em,{children:"transmitted"})," by the resource. And ",(0,t.jsx)(i.code,{children:"total"})," is the combined ",(0,t.jsx)(i.code,{children:"rx"}),"+",(0,t.jsx)(i.code,{children:"tx"})," value."]}),"\n",(0,t.jsxs)(i.p,{children:["If the traffic quantity is greater than the ",(0,t.jsx)(i.code,{children:"warning"})," threshold, the user will receive an email notification letting them know that their data transfer size is rising and will eventually be limited (the email details the limit threshold)."]}),"\n",(0,t.jsxs)(i.p,{children:["If the traffic quantity is greater than the ",(0,t.jsx)(i.code,{children:"limit"})," threshold, the resources will be limited until the traffic in the window (the last 5 minutes in our example) falls back below the ",(0,t.jsx)(i.code,{children:"limit"})," threshold."]}),"\n",(0,t.jsx)(i.h3,{id:"limit-actions",children:"Limit Actions"}),"\n",(0,t.jsx)(i.p,{children:"When a resource is limited, the actions taken differ depending on what kind of resource is being limited."}),"\n",(0,t.jsxs)(i.p,{children:["When a share is limited, the dial service policies for that share are removed. No other action is taken. This means that public frontends will simply return a ",(0,t.jsx)(i.code,{children:"404"})," as if the share is no longer there. Private frontends will also return ",(0,t.jsx)(i.code,{children:"404"})," errors. When the limit is relaxed, the dial policies are put back in place and the share will continue operating normally."]}),"\n",(0,t.jsx)(i.p,{children:"When an environment is limited, all of the shares in that environment become limited, and the user is not able to create new shares in that environment. When the limit is relaxed, all of the share limits are relaxed and the user is again able to add shares to the environment."}),"\n",(0,t.jsx)(i.p,{children:"When an account is limited, all of the environments in that account become limited (limiting all of the shares), and the user is not able to create new environments or shares. When the limit is relaxed, all of the environments and shares will return to normal operation."}),"\n",(0,t.jsx)(i.h2,{id:"unlimited-accounts",children:"Unlimited Accounts"}),"\n",(0,t.jsxs)(i.p,{children:["The ",(0,t.jsx)(i.code,{children:"accounts"})," table in the database includes a ",(0,t.jsx)(i.code,{children:"limitless"})," column. When this column is set to ",(0,t.jsx)(i.code,{children:"true"})," the account is not subject to any of the limits in the system."]})]})}function d(e={}){const{wrapper:i}={...(0,s.a)(),...e.components};return i?(0,t.jsx)(i,{...e,children:(0,t.jsx)(h,{...e})}):h(e)}},1151:(e,i,n)=>{n.d(i,{Z:()=>l,a:()=>o});var t=n(7294);const s={},r=t.createContext(s);function o(e){const i=t.useContext(r);return t.useMemo((function(){return"function"==typeof e?e(i):{...i,...e}}),[i,e])}function l(e){let i;return i=e.disableParentContext?"function"==typeof e.components?e.components(s):e.components||s:o(e.components),t.createElement(r.Provider,{value:i},e.children)}}}]); |