mcaptcha-website/docs/introduction/configuring-difficulty-factor/index.html

26 lines
16 KiB
HTML
Raw Normal View History

<!doctype html><html lang=en-us><head><meta charset=utf-8><meta http-equiv=x-ua-compatible content="ie=edge"><meta name=viewport content="width=device-width,initial-scale=1,shrink-to-fit=no"><link rel=preload as=font href=/fonts/vendor/jost/jost-v4-latin-regular.woff2 type=font/woff2 crossorigin><link rel=preload as=font href=/fonts/vendor/jost/jost-v4-latin-700.woff2 type=font/woff2 crossorigin><link rel=stylesheet href=/main.f4e82f75f039986a07346a99687f11e3218d588abe9b9daa7d0673b1a7aaee5b689ec69619c26a2962d5a124bed33807d58bd84180c249bbb8eddc33c5ef5baa.css integrity="sha512-9OgvdfA5mGoHNGqZaH8R4yGNWIq+m52qfQZzsaeq7ltonsaWGcJqKWLVoSS+0zgH1YvYQYDCSbu47dwzxe9bqg==" crossorigin=anonymous><noscript><style>img.lazyload{display:none}</style></noscript><meta name=robots content="index, follow"><meta name=googlebot content="index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1"><meta name=bingbot content="index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1"><title>Configuring Difficulty Factor - mCaptcha</title><meta name=description content="mCaptcha has options to configure its proof of work engine behavior, this page explains how to determine difficulty facotrs that work best for your website!"><link rel=canonical href=/docs/introduction/configuring-difficulty-factor/><meta name=twitter:card content="summary_large_image"><meta name=twitter:image content="/icon.png"><meta name=twitter:title content="Configuring Difficulty Factor"><meta name=twitter:description content="mCaptcha has options to configure its proof of work engine behavior, this page explains how to determine difficulty facotrs that work best for your website!"><meta name=twitter:site content="@"><meta name=twitter:creator content="@"><meta property="og:title" content="Configuring Difficulty Factor"><meta property="og:description" content="mCaptcha has options to configure its proof of work engine behavior, this page explains how to determine difficulty facotrs that work best for your website!"><meta property="og:type" content="article"><meta property="og:url" content="/docs/introduction/configuring-difficulty-factor/"><meta property="og:image" content="/icon.png"><meta property="article:published_time" content="2022-06-22T00:00:00+00:00"><meta property="article:modified_time" content="2022-08-01T23:03:44+05:30"><meta property="og:site_name" content="mCaptcha"><meta property="article:publisher" content="https://www.facebook.com/"><meta property="article:author" content="https://www.facebook.com/"><meta property="og:locale" content="en_US"><script type=application/ld+json>{"@context":"http://schema.org","@type":"BreadcrumbList","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"\/"},{"@type":"ListItem","position":2,"name":"Docsintroductionconfiguring Difficulty Factor","item":"\/docsintroductionconfiguring-difficulty-factor\/"}]}</script><meta name=theme-color content="#fff"><link rel=apple-touch-icon sizes=180x180 href=/apple-touch-icon.png><link rel=icon type=image/png sizes=32x32 href=/favicon-32x32.png><link rel=icon type=image/png sizes=16x16 href=/favicon-16x16.png><link rel=manifest href=/site.webmanifest></head><body class="docs single"><div class="header-bar fixed-top"></div><header class="navbar fixed-top navbar-expand-md navbar-light"><div class=container><input class="menu-btn order-0" type=checkbox id=menu-btn>
<label class="menu-icon d-md-none" for=menu-btn><span class=navicon></span></label><a class="navbar-brand order-1 order-md-0 me-auto" href=/>mCaptcha</a>
<button id=mode class="btn btn-link order-2 order-md-4" type=button aria-label="Toggle mode">
<span class=toggle-dark><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentcolor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-moon"><path d="M21 12.79A9 9 0 1111.21 3 7 7 0 0021 12.79z"/></svg></span><span class=toggle-light><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentcolor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-sun"><circle cx="12" cy="12" r="5"/><line x1="12" y1="1" x2="12" y2="3"/><line x1="12" y1="21" x2="12" y2="23"/><line x1="4.22" y1="4.22" x2="5.64" y2="5.64"/><line x1="18.36" y1="18.36" x2="19.78" y2="19.78"/><line x1="1" y1="12" x2="3" y2="12"/><line x1="21" y1="12" x2="23" y2="12"/><line x1="4.22" y1="19.78" x2="5.64" y2="18.36"/><line x1="18.36" y1="5.64" x2="19.78" y2="4.22"/></svg></span></button><ul class="navbar-nav social-nav order-3 order-md-5"><li class=nav-item><a class=nav-link href=https://github.com/mCaptcha><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentcolor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-github"><path d="M9 19c-5 1.5-5-2.5-7-3m14 6v-3.87a3.37 3.37.0 00-.94-2.61c3.14-.35 6.44-1.54 6.44-7A5.44 5.44.0 0020 4.77 5.07 5.07.0 0019.91 1S18.73.65 16 2.48a13.38 13.38.0 00-7 0C6.27.65 5.09 1 5.09 1A5.07 5.07.0 005 4.77 5.44 5.44.0 003.5 8.55c0 5.42 3.3 6.61 6.44 7A3.37 3.37.0 009 18.13V22"/></svg><span class="ms-2 visually-hidden">GitHub</span></a></li></ul><div class="collapse navbar-collapse order-4 order-md-1"><ul class="navbar-nav main-nav me-auto order-5 order-md-2"><li class=nav-item><a class=nav-link href=/blog/>Blog</a></li><li class=nav-item><a class=nav-link href=/community/>Community</a></li><li class=nav-item><a class=nav-link href=/contact/>Contact</a></li><li class=nav-item><a class=nav-link href=/about/>About</a></li><li class="nav-item active"><a class=nav-link href=/docs/introduction/installing-captcha/>Docs</a></li></ul><div class="break order-6 d-md-none"></div><form class="navbar-form flex-grow-1 order-7 order-md-3"><input id=userinput class="form-control is-search" type=search placeholder="Search docs..." aria-label="Search docs..." autocomplete=off><div id=suggestions class="shadow bg-white rounded"></div></form></div></div></header><div class="wrap container" role=document><div class=content><div class="row flex-xl-nowrap"><div class="col-lg-5 col-xl-4 docs-sidebar"><nav class=docs-links aria-label="Main navigation"><h3>Introduction</h3><ul class=list-unstyled><li><a class=docs-link href=/docs/introduction/installing-captcha/>Installing mCaptcha on your website</a></li><li><a class="docs-link active" href=/docs/introduction/configuring-difficulty-factor/>Configuring Difficulty Factor</a></li></ul><h3>Terminology</h3><ul class=list-unstyled><li><a class=docs-link href=/docs/terminology/access-token/>Access token</a></li><li><a class=docs-link href=/docs/terminology/cooldown-period/>Cooldown Period</a></li><li><a class=docs-link href=/docs/terminology/difficulty-factor/>Difficulty Factor</a></li><li><a class=docs-link href=/docs/terminology/sitekey/>Site key</a></li><li><a class=docs-link href=/docs/terminology/visitor-threshold/>Visitor Threshold</a></li></ul><h3>Self-Hosted</h3><ul class=list-unstyled><li><a class=docs-link href=/docs/self-hosted/getting-started/>Getting started</a></li><li><a class=docs-link href=/docs/self-hosted/bare-metal/>Deploy bare metal</a></li><li><a class=docs-link href=/docs/self-hosted/docker/>Using Docker</a></li><li><a class=docs-link href=/docs/self-hosted/dependencies/>Database and cache</a></li></ul><h3>API</h3><ul class=list-unstyled><li><a class=docs-link href=/docs/api/browser/>Browser libraries</a></li><li><a class=docs-link href=/docs/api/mcaptcha-system/>mCaptcha System Library</a></li><li><a class=docs-link href=/docs/api/pow-sha256/>pow_sha256</a></li></ul><h3>Help</h3><ul class=list-unstyled><li><a class=docs
advised to take advantage of it by setting low <a href=/docs/terminology/difficulty-factor/>difficulty
factors</a> for normal traffic levels
for their website.</p><p><strong>Lowest advisable difficulty factor is 5000.</strong></p><p>For instance, if it is normal for my website to get 2000 requests for
every 30 seconds, I will set a <a href=/docs/terminology/cooldown-period>cool
down</a> period of 30 seconds and the
first level of difficulty configuration will have a <a href=/docs/terminology/visitor-threshold>visitor threshold</a> of 2000 with a
difficulty factor of 5000.</p><p>There are two modes to setting difficulty factor for your website on
mCaptcha:</p><h3 id=easy-option>Easy option<a href=#easy-option class=anchor aria-hidden=true>#</a></h3><p>Easy mode asks a few basic statistics about your website and generates a
configuration that should work for your website. Currently, easy mode is
guided by assumptions on suitable difficulty factors to protect a
website but it will be fine-tuned as mCaptcha sees more deployment.</p><p>Configuration generated by easy mode can be tweaked later using the
advance mode, as you become more familiar with how mCaptcha works.</p><figure><img class="img-fluid lazyload blur-up" data-sizes=auto src=/docs/introduction/configuring-difficulty-factor/new-sitekey-easy-mode_hu3f66189ea53484ac6603a2d78fa015c8_26636_20x0_resize_box_2.png data-srcset="/docs/introduction/configuring-difficulty-factor/new-sitekey-easy-mode_hu3f66189ea53484ac6603a2d78fa015c8_26636_900x0_resize_box_2.png 900w,/docs/introduction/configuring-difficulty-factor/new-sitekey-easy-mode_hu3f66189ea53484ac6603a2d78fa015c8_26636_800x0_resize_box_2.png 800w,/docs/introduction/configuring-difficulty-factor/new-sitekey-easy-mode_hu3f66189ea53484ac6603a2d78fa015c8_26636_700x0_resize_box_2.png 700w,/docs/introduction/configuring-difficulty-factor/new-sitekey-easy-mode_hu3f66189ea53484ac6603a2d78fa015c8_26636_600x0_resize_box_2.png 600w,/docs/introduction/configuring-difficulty-factor/new-sitekey-easy-mode_hu3f66189ea53484ac6603a2d78fa015c8_26636_500x0_resize_box_2.png 500w" width=720 height=452 alt="new sitekey form in easy mode"><noscript><img class=img-fluid sizes=100vw srcset="/docs/introduction/configuring-difficulty-factor/new-sitekey-easy-mode_hu3f66189ea53484ac6603a2d78fa015c8_26636_900x0_resize_box_2.png 900w,/docs/introduction/configuring-difficulty-factor/new-sitekey-easy-mode_hu3f66189ea53484ac6603a2d78fa015c8_26636_800x0_resize_box_2.png 800w,/docs/introduction/configuring-difficulty-factor/new-sitekey-easy-mode_hu3f66189ea53484ac6603a2d78fa015c8_26636_700x0_resize_box_2.png 700w,/docs/introduction/configuring-difficulty-factor/new-sitekey-easy-mode_hu3f66189ea53484ac6603a2d78fa015c8_26636_600x0_resize_box_2.png 600w,/docs/introduction/configuring-difficulty-factor/new-sitekey-easy-mode_hu3f66189ea53484ac6603a2d78fa015c8_26636_500x0_resize_box_2.png 500w" src=/docs/introduction/configuring-difficulty-factor/new-sitekey-easy-mode.png width=720 height=452 alt="new sitekey form in easy mode"></noscript></figure><h3 id=advance-option>Advance option<a href=#advance-option class=anchor aria-hidden=true>#</a></h3><p>Advance mode gives the admin granular control over how mCaptcha behaves
on their website. It has options to set the difficulty factor for each
level of traffic(or visitor threshold, in mCaptcha speak), fully taking
advantage of mCaptcha&rsquo;s variable difficulty factor feature.</p><p>For instance, if it is normal for a website to get 200 requests over 30
seconds, then setting a very low difficulty factor for a visitor
threshold of 200 and a cool down period of 30 seconds will allow the
users to pass through without waiting on the CAPTCHA. But if 1000
requests over 30 seconds will bring down the service, then the admin can
configure increasing levels of difficulty factor of increasing traffic
levels, effectively rate limiting its users and protecting the
underlying website.</p><figure><img class="img-fluid lazyload blur-up" data-sizes=auto src=/docs/introduction/configuring-difficulty-factor/new-sitekey-adv-mode_huc4867c6295dc4be195d832a52b37239b_23312_20x0_resize_box_2.png data-srcset="/docs/introduction/configuring-difficulty-factor/new-sitekey-adv-mode_huc4867c6295dc4be195d832a52b37239b_23312_900x0_resize_box_2.png 900w,/docs/introduction/configuring-difficulty-factor/new-sitekey-adv-mode_huc4867c6295dc4be195d832a52b37239b_23312_800x0_resize_box_2.png 800w,/docs/introduction/configuring-difficulty-factor/new-sitekey-adv-mode_huc4867c6295dc4be195d832a52b37239b_23312_700x0_resize_box_2.png 700w,/docs/introduction/configuring-difficulty-factor/new-sitekey-adv-mode_huc4867c6295dc4be195d832a52b37239b_23312_600x0_resize_box_2.png 600w,/docs/introduction/configuring-difficulty-factor/new-sitekey-adv-mode_huc4867c6295dc4be195d832a52b37239b_23312_500x0_resize_box_2.png 500w" width=720 height=407 alt="new sitekey form in advance mode"><noscript><img class=img-fluid sizes=100vw srcset="/docs/introduction/configuring-difficulty-factor/new-sitekey-adv-mode_huc4867c6295dc4be195d832a52b37239b_23312_900x0_resize_box_2.png 900w,/docs/introduction/configuring-difficulty-factor/new-sitekey-adv-mode_huc4867c6295dc4be195d832a52b37239b_23312_800x0_resize_box_2.png 800w,/docs/introduction/configuring-difficulty-factor/new-sitekey-adv-mode_huc4867c6295dc4be195d832a52b37239b_23312_700x0_resize_box_2.png 700w,/docs/introduction/configuring-difficulty-factor/new-sitekey-adv-mode_huc4867c6295dc4be195d832a52b37239b_23312_600x0_resize_box_2.png 600w,/docs/introduction/configuring-difficulty-factor/new-sitekey-adv-mode_huc4867c6295dc4be195d832a52b37239b_23312_500x0_resize_box_2.png 500w" src=/docs/introduction/configuring-difficulty-factor/new-sitekey-adv-mode.png width=720 height=407 alt="new sitekey form in advance mode"></noscript></figure><p class=edit-page><a href=https://github.com/mCaptcha/website/blob/master/content/docs/introduction/configuring-difficulty-factor/index.md><svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentcolor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-edit-2"><path d="M17 3a2.828 2.828.0 114 4L7.5 20.5 2 22l1.5-5.5L17 3z"/></svg>Edit this page on GitHub</a></p><div class="docs-navigation d-flex justify-content-between"><a href=/docs/introduction/installing-captcha/><div class="card my-1"><div class="card-body py-2">&larr; Installing mCaptcha on your website</div></div></a><a class=ms-auto href=/docs/terminology/access-token/><div class="card my-1"><div class="card-body py-2">Access token &rarr;</div></div></a></div></main></div></div></div><footer class="footer text-muted"><div class=container><div class=row><div class="col-lg-8 order-last order-lg-first"><ul class=list-inline><li class=list-inline-item>Powered by <a href=https://gohugo.io/>Hugo</a>, and <a href=https://getdoks.org/>Doks</a></li></ul></div><div class="col-lg-8 order-first order-lg-last text-lg-end"><ul class=list-inline><li class=list-inline-item><a href=/about/>About</a></li><li class=list-inline-item><a href=/donate>Donate</a></li><li class=list-inline-item><a href=/privacy-policy/>Privacy</a></li><li class=list-inline-item><a href=/security>Security</a></li><li class=list-inline-item><a href=https://stats.uptimerobot.com/GK7VLFJnBl>Status</a></li><li class=list-inline-item><a href=/thanks>Thanks</a></li></ul></div></div></div></footer><script src=/main.min.993b2b4c58b07e7a4bb3423cf18ccd78a85d0063680c0fc9bf6d9cc02be98e08793034d984dd8f7c60ad5b70f3186cc8bc280b1077b7e37c2d64f36f118099bb.js integrity="sha512-mTsrTFiwfnpLs0I88YzNeKhdAGNoDA/Jv22cwCvpjgh5MDTZhN2PfGCtW3DzGGzIvCgLEHe343wtZPNvEYCZuw==" crossorigin=anonymous defer></script><script src=/index.min.9f6ca8d18a9feb4c8173940752baf80e8075b025ffbfcec12016beb0c2f8f794667102d45eb9accca8c374b0dd7a69af667e0f20813fb4fb086e6cda5230e2d8.js integrity="sha512-n2yo0Yqf60yBc5QHUrr4DoB1sCX/v87BIBa+sML495RmcQLUXrmszKjDdLDdemmvZn4PIIE/tPsIbmzaUjDi2A==" crossorigin=a