blob: 76db5c4e440e1cd01cb84a28b829d66d114b3838 [file] [log] [blame]
<!DOCTYPE html>
<html lang="stable" class="js csstransforms3d">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="generator" content="Hugo 0.81.0" />
<meta name="description" content="A set of micro-services for connecting millions of devices.">
<meta name="author" content="The Eclipse Hono Project">
<link rel="apple-touch-icon" sizes="180x180" href="/hono/docs/favicon/apple-touch-icon.png">
<link rel="icon" type="image/png" sizes="48x48" href="/hono/docs/favicon/favicon-48x48.png">
<link rel="icon" type="image/png" sizes="32x32" href="/hono/docs/favicon/favicon-32x32.png">
<link rel="icon" type="image/png" sizes="16x16" href="/hono/docs/favicon/favicon-16x16.png">
<link rel="manifest" href="/hono/docs/favicon/site.webmanifest">
<link rel="mask-icon" href="/hono/docs/favicon/safari-pinned-tab.svg" color="#5bbad5">
<link rel="shortcut icon" href="/hono/docs/favicon/favicon.ico">
<meta name="msapplication-TileColor" content="#da532c">
<meta name="msapplication-config" content="/hono/docs/favicon/browserconfig.xml">
<meta name="theme-color" content="#ffffff">
<title>Limiting Resource Usage :: Eclipse Hono&trade;</title>
<link href="/hono/docs/css/nucleus.css?1626138714" rel="stylesheet">
<link href="/hono/docs/css/fontawesome-all.min.css?1626138714" rel="stylesheet">
<link href="/hono/docs/css/hybrid.css?1626138714" rel="stylesheet">
<link href="/hono/docs/css/featherlight.min.css?1626138714" rel="stylesheet">
<link href="/hono/docs/css/perfect-scrollbar.min.css?1626138714" rel="stylesheet">
<link href="/hono/docs/css/auto-complete.css?1626138714" rel="stylesheet">
<link href="/hono/docs/css/atom-one-dark-reasonable.css?1626138714" rel="stylesheet">
<link href="/hono/docs/css/theme.css?1626138714" rel="stylesheet">
<link href="/hono/docs/css/hugo-theme.css?1626138714" rel="stylesheet">
<link href="/hono/docs/css/theme-hono.css?1626138714" rel="stylesheet">
<link href="/hono/docs/css/hono.css?1626138714" rel="stylesheet">
<script src="/hono/docs/js/jquery-3.3.1.min.js?1626138714"></script>
<style>
:root #header + #content > #left > #rlblock_left{
display:none !important;
}
:not(pre) > code + span.copy-to-clipboard {
display: none;
}
</style>
<link rel="stylesheet" href="https://www.eclipse.org/eclipse.org-common/themes/solstice/public/stylesheets/vendor/cookieconsent/cookieconsent.min.css">
<meta name="twitter:card" content="summary_large_image">
<meta name="twitter:site" content="@EclipseHono">
<meta name="twitter:title" content="Limiting Resource Usage :: Eclipse Hono&amp;trade;">
<meta name="twitter:image" content="https://www.eclipse.org/hono/docs/images/twitter_image.png">
<meta name="twitter:description" content="A set of micro-services for connecting millions of devices.">
<meta property="og:title" content="Limiting Resource Usage :: Eclipse Hono&amp;trade;" />
<meta property="og:type" content="website" />
<meta property="og:url" content="https://www.eclipse.org/hono/docs/deployment/resource-limitation//" />
<meta property="og:image" content="https://www.eclipse.org/hono/docs/images/twitter_image.png" />
</head>
<body class="" data-url="/hono/docs/deployment/resource-limitation/">
<nav id="sidebar" class="">
<div id="header-wrapper">
<div id="header">
<a href="https://www.eclipse.org/hono/">
<img src="/hono/docs/images/HONO-Logo_Bild-Wort_quer-w-310x120px.svg" alt="Hono logo" class="logo-img">
</a>
</div>
<div class="searchbox">
<label for="search-by"><i class="fas fa-search"></i></label>
<input data-search-input id="search-by" type="search" placeholder="Search...">
<span data-search-clear=""><i class="fas fa-times"></i></span>
</div>
<script type="text/javascript" src="/hono/docs/js/lunr.min.js?1626138714"></script>
<script type="text/javascript" src="/hono/docs/js/auto-complete.js?1626138714"></script>
<script type="text/javascript">
var baseurl = "https:\/\/www.eclipse.org\/hono\/docs\/";
</script>
<script type="text/javascript" src="/hono/docs/js/search.js?1626138714"></script>
</div>
<div class="highlightable">
<ul class="topics">
<li data-nav-id="/hono/docs/concepts/" title="Concepts" class="dd-item
">
<a href="/hono/docs/concepts/">
<i class="far fa-lightbulb"></i> Concepts
</a>
<ul>
<li data-nav-id="/hono/docs/concepts/device-identity/" title="Device Identity" class="dd-item ">
<a href="/hono/docs/concepts/device-identity/">
Device Identity
</a>
</li>
<li data-nav-id="/hono/docs/concepts/tenancy/" title="Multi-Tenancy" class="dd-item ">
<a href="/hono/docs/concepts/tenancy/">
Multi-Tenancy
</a>
</li>
<li data-nav-id="/hono/docs/concepts/device-provisioning/" title="Device Provisioning" class="dd-item ">
<a href="/hono/docs/concepts/device-provisioning/">
Device Provisioning
</a>
</li>
<li data-nav-id="/hono/docs/concepts/connecting-devices/" title="Connecting Devices" class="dd-item ">
<a href="/hono/docs/concepts/connecting-devices/">
Connecting Devices
</a>
</li>
<li data-nav-id="/hono/docs/concepts/device-notifications/" title="Device Notifications" class="dd-item ">
<a href="/hono/docs/concepts/device-notifications/">
Device Notifications
</a>
</li>
<li data-nav-id="/hono/docs/concepts/command-and-control/" title="Command &amp; Control" class="dd-item ">
<a href="/hono/docs/concepts/command-and-control/">
Command &amp; Control
</a>
</li>
<li data-nav-id="/hono/docs/concepts/resource-limits/" title="Resource limits" class="dd-item ">
<a href="/hono/docs/concepts/resource-limits/">
Resource limits
</a>
</li>
<li data-nav-id="/hono/docs/concepts/connection-events/" title="Connection Events" class="dd-item ">
<a href="/hono/docs/concepts/connection-events/">
Connection Events
</a>
</li>
</ul>
</li>
<li data-nav-id="/hono/docs/user-guide/" title="User Guide" class="dd-item
">
<a href="/hono/docs/user-guide/">
<i class="fas fa-book-reader"></i> User Guide
</a>
<ul>
<li data-nav-id="/hono/docs/user-guide/mongodb-based-device-registry/" title="MongoDB Based Device Registry" class="dd-item ">
<a href="/hono/docs/user-guide/mongodb-based-device-registry/">
MongoDB Based Device Registry
</a>
</li>
<li data-nav-id="/hono/docs/user-guide/jdbc-based-device-registry/" title="JDBC Based Device Registry" class="dd-item ">
<a href="/hono/docs/user-guide/jdbc-based-device-registry/">
JDBC Based Device Registry
</a>
</li>
<li data-nav-id="/hono/docs/user-guide/file-based-device-registry/" title="File Based Device Registry" class="dd-item ">
<a href="/hono/docs/user-guide/file-based-device-registry/">
File Based Device Registry
</a>
</li>
<li data-nav-id="/hono/docs/user-guide/http-adapter/" title="HTTP Adapter" class="dd-item ">
<a href="/hono/docs/user-guide/http-adapter/">
HTTP Adapter
</a>
</li>
<li data-nav-id="/hono/docs/user-guide/mqtt-adapter/" title="MQTT Adapter" class="dd-item ">
<a href="/hono/docs/user-guide/mqtt-adapter/">
MQTT Adapter
</a>
</li>
<li data-nav-id="/hono/docs/user-guide/amqp-adapter/" title="AMQP Adapter" class="dd-item ">
<a href="/hono/docs/user-guide/amqp-adapter/">
AMQP Adapter
</a>
</li>
<li data-nav-id="/hono/docs/user-guide/coap-adapter/" title="CoAP Adapter" class="dd-item ">
<a href="/hono/docs/user-guide/coap-adapter/">
CoAP Adapter
</a>
</li>
<li data-nav-id="/hono/docs/user-guide/kura-adapter/" title="Kura Adapter" class="dd-item ">
<a href="/hono/docs/user-guide/kura-adapter/">
Kura Adapter
</a>
</li>
<li data-nav-id="/hono/docs/user-guide/sigfox-adapter/" title="Sigfox Adapter" class="dd-item ">
<a href="/hono/docs/user-guide/sigfox-adapter/">
Sigfox Adapter
</a>
</li>
</ul>
</li>
<li data-nav-id="/hono/docs/admin-guide/" title="Admin Guide" class="dd-item
">
<a href="/hono/docs/admin-guide/">
<i class="fas fa-sliders-h"></i> Admin Guide
</a>
<ul>
<li data-nav-id="/hono/docs/admin-guide/common-config/" title="Common Configuration" class="dd-item ">
<a href="/hono/docs/admin-guide/common-config/">
Common Configuration
</a>
</li>
<li data-nav-id="/hono/docs/admin-guide/auth-server-config/" title="Auth Server Configuration" class="dd-item ">
<a href="/hono/docs/admin-guide/auth-server-config/">
Auth Server Configuration
</a>
</li>
<li data-nav-id="/hono/docs/admin-guide/mongodb-device-registry-config/" title="MongoDB Based Device Registry Configuration" class="dd-item ">
<a href="/hono/docs/admin-guide/mongodb-device-registry-config/">
MongoDB Based Device Registry Configuration
</a>
</li>
<li data-nav-id="/hono/docs/admin-guide/jdbc-device-registry-config/" title="JDBC Based Device Registry Configuration" class="dd-item ">
<a href="/hono/docs/admin-guide/jdbc-device-registry-config/">
JDBC Based Device Registry Configuration
</a>
</li>
<li data-nav-id="/hono/docs/admin-guide/file-based-device-registry-config/" title="File Based Device Registry Configuration" class="dd-item ">
<a href="/hono/docs/admin-guide/file-based-device-registry-config/">
File Based Device Registry Configuration
</a>
</li>
<li data-nav-id="/hono/docs/admin-guide/command-router-config/" title="Configuring the Command Router Service" class="dd-item ">
<a href="/hono/docs/admin-guide/command-router-config/">
Command Router Service Configuration
</a>
</li>
<li data-nav-id="/hono/docs/admin-guide/device-connection-config/" title="Configuring the Device Connection Service" class="dd-item ">
<a href="/hono/docs/admin-guide/device-connection-config/">
Device Connection Service Configuration
</a>
</li>
<li data-nav-id="/hono/docs/admin-guide/http-adapter-config/" title="HTTP Adapter Configuration" class="dd-item ">
<a href="/hono/docs/admin-guide/http-adapter-config/">
HTTP Adapter Configuration
</a>
</li>
<li data-nav-id="/hono/docs/admin-guide/mqtt-adapter-config/" title="MQTT Adapter Configuration" class="dd-item ">
<a href="/hono/docs/admin-guide/mqtt-adapter-config/">
MQTT Adapter Configuration
</a>
</li>
<li data-nav-id="/hono/docs/admin-guide/amqp-adapter-config/" title="AMQP Adapter Configuration" class="dd-item ">
<a href="/hono/docs/admin-guide/amqp-adapter-config/">
AMQP Adapter Configuration
</a>
</li>
<li data-nav-id="/hono/docs/admin-guide/coap-adapter-config/" title="CoAP Adapter Configuration" class="dd-item ">
<a href="/hono/docs/admin-guide/coap-adapter-config/">
CoAP Adapter Configuration
</a>
</li>
<li data-nav-id="/hono/docs/admin-guide/kura-adapter-config/" title="Kura Adapter Configuration" class="dd-item ">
<a href="/hono/docs/admin-guide/kura-adapter-config/">
Kura Adapter Configuration
</a>
</li>
<li data-nav-id="/hono/docs/admin-guide/hono-client-configuration/" title="Hono Client Configuration" class="dd-item ">
<a href="/hono/docs/admin-guide/hono-client-configuration/">
Hono Client Configuration
</a>
</li>
<li data-nav-id="/hono/docs/admin-guide/hono-kafka-client-configuration/" title="Hono Kafka Client Configuration" class="dd-item ">
<a href="/hono/docs/admin-guide/hono-kafka-client-configuration/">
Hono Kafka Client Configuration
</a>
</li>
<li data-nav-id="/hono/docs/admin-guide/amqp-network-config/" title="AMQP 1.0 Messaging Network Configuration" class="dd-item ">
<a href="/hono/docs/admin-guide/amqp-network-config/">
AMQP 1.0 Messaging Network Configuration
</a>
</li>
<li data-nav-id="/hono/docs/admin-guide/secure_communication/" title="Secure Communication" class="dd-item ">
<a href="/hono/docs/admin-guide/secure_communication/">
Secure Communication
</a>
</li>
<li data-nav-id="/hono/docs/admin-guide/monitoring-tracing-config/" title="Monitoring &amp; Tracing" class="dd-item ">
<a href="/hono/docs/admin-guide/monitoring-tracing-config/">
Monitoring &amp; Tracing
</a>
</li>
</ul>
</li>
<li data-nav-id="/hono/docs/dev-guide/" title="Developer Guide" class="dd-item
">
<a href="/hono/docs/dev-guide/">
<i class="fas fa-tools"></i> Developer Guide
</a>
<ul>
<li data-nav-id="/hono/docs/dev-guide/building_hono/" title="Building from Source" class="dd-item ">
<a href="/hono/docs/dev-guide/building_hono/">
Building from Source
</a>
</li>
<li data-nav-id="/hono/docs/dev-guide/amqp_adapter_client/" title="AMQP Adapter Client for Java" class="dd-item ">
<a href="/hono/docs/dev-guide/amqp_adapter_client/">
AMQP Adapter Client for Java
</a>
</li>
<li data-nav-id="/hono/docs/dev-guide/java_client_consumer/" title="Consuming Messages from Java" class="dd-item ">
<a href="/hono/docs/dev-guide/java_client_consumer/">
Consuming Messages from Java
</a>
</li>
<li data-nav-id="/hono/docs/dev-guide/custom_http_adapter/" title="Implement a Custom Hono HTTP Protocol Adapter" class="dd-item ">
<a href="/hono/docs/dev-guide/custom_http_adapter/">
Implement a Custom Hono HTTP Protocol Adapter
</a>
</li>
</ul>
</li>
<li data-nav-id="/hono/docs/api/" title="API" class="dd-item
">
<a href="/hono/docs/api/">
&nbsp;<i class='fas fa-plug'></i>&nbsp;API
</a>
<ul>
<li data-nav-id="/hono/docs/api/telemetry/" title="Telemetry API Specification" class="dd-item ">
<a href="/hono/docs/api/telemetry/">
Telemetry API
</a>
</li>
<li data-nav-id="/hono/docs/api/event/" title="Event API Specification" class="dd-item ">
<a href="/hono/docs/api/event/">
Event API
</a>
</li>
<li data-nav-id="/hono/docs/api/command-and-control/" title="Command &amp; Control API Specification" class="dd-item ">
<a href="/hono/docs/api/command-and-control/">
Command &amp; Control API
</a>
</li>
<li data-nav-id="/hono/docs/api/kafka-api/" title="Kafka-based APIs" class="dd-item ">
<a href="/hono/docs/api/kafka-api/">
Kafka-based APIs
</a>
</li>
<li data-nav-id="/hono/docs/api/telemetry-kafka/" title="Telemetry API for Kafka Specification" class="dd-item ">
<a href="/hono/docs/api/telemetry-kafka/">
Telemetry API for Kafka
</a>
</li>
<li data-nav-id="/hono/docs/api/event-kafka/" title="Event API for Kafka Specification" class="dd-item ">
<a href="/hono/docs/api/event-kafka/">
Event API for Kafka
</a>
</li>
<li data-nav-id="/hono/docs/api/command-and-control-kafka/" title="Command &amp; Control API for Kafka Specification" class="dd-item ">
<a href="/hono/docs/api/command-and-control-kafka/">
Command &amp; Control API for Kafka
</a>
</li>
<li data-nav-id="/hono/docs/api/tenant/" title="Tenant API Specification" class="dd-item ">
<a href="/hono/docs/api/tenant/">
Tenant API
</a>
</li>
<li data-nav-id="/hono/docs/api/command-router/" title="Command Router API Specification" class="dd-item ">
<a href="/hono/docs/api/command-router/">
Command Router API
</a>
</li>
<li data-nav-id="/hono/docs/api/device-connection/" title="Device Connection API Specification" class="dd-item ">
<a href="/hono/docs/api/device-connection/">
Device Connection API
</a>
</li>
<li data-nav-id="/hono/docs/api/device-registration/" title="Device Registration API Specification" class="dd-item ">
<a href="/hono/docs/api/device-registration/">
Device Registration API
</a>
</li>
<li data-nav-id="/hono/docs/api/credentials/" title="Credentials API Specification" class="dd-item ">
<a href="/hono/docs/api/credentials/">
Credentials API
</a>
</li>
<li data-nav-id="/hono/docs/api/authentication/" title="Authentication API Specification" class="dd-item ">
<a href="/hono/docs/api/authentication/">
Authentication API
</a>
</li>
<li data-nav-id="/hono/docs/api/management/" title="Device Registry Management API Specification" class="dd-item ">
<a href="/hono/docs/api/management/">
Device Registry Management API
</a>
</li>
<li data-nav-id="/hono/docs/api/metrics/" title="Metrics" class="dd-item ">
<a href="/hono/docs/api/metrics/">
Metrics
</a>
</li>
</ul>
</li>
<li data-nav-id="/hono/docs/deployment/" title="Deployment" class="dd-item
parent
">
<a href="/hono/docs/deployment/">
<i class="fas fa-shipping-fast"></i> Deployment
</a>
<ul>
<li data-nav-id="/hono/docs/deployment/helm-based-deployment/" title="Helm based Deployment" class="dd-item ">
<a href="/hono/docs/deployment/helm-based-deployment/">
Helm based Deployment
</a>
</li>
<li data-nav-id="/hono/docs/deployment/openshift/" title="OpenShift / OKD" class="dd-item ">
<a href="/hono/docs/deployment/openshift/">
OpenShift / OKD
</a>
</li>
<li data-nav-id="/hono/docs/deployment/create-kubernetes-cluster/" title="Setting up a Kubernetes Cluster" class="dd-item ">
<a href="/hono/docs/deployment/create-kubernetes-cluster/">
Setting up a Kubernetes Cluster
</a>
</li>
<li data-nav-id="/hono/docs/deployment/resource-limitation/" title="Limiting Resource Usage" class="dd-item active">
<a href="/hono/docs/deployment/resource-limitation/">
Limiting Resource Usage
</a>
</li>
</ul>
</li>
<li data-nav-id="/hono/docs/architecture/" title="Architecture" class="dd-item
">
<a href="/hono/docs/architecture/">
<i class="fas fa-landmark"></i> Architecture
</a>
<ul>
<li data-nav-id="/hono/docs/architecture/component-view/" title="Component View" class="dd-item ">
<a href="/hono/docs/architecture/component-view/">
Component View
</a>
</li>
<li data-nav-id="/hono/docs/architecture/auth/" title="Authentication/Authorization" class="dd-item ">
<a href="/hono/docs/architecture/auth/">
Authentication/Authorization
</a>
</li>
</ul>
</li>
</ul>
<section id="shortcuts">
<h3></h3>
<ul>
<li>
<a class="padding" href="https://www.eclipse.org/hono/" title="Hono&#39;s Homepage"><i class='fas fa-home'></i> Hono Home</a>
</li>
<li>
<a class="padding" href="https://www.eclipse.org/hono/getting-started/" title="Getting started with Eclipse Hono"><i class='fas fa-plane-departure'></i> Getting Started</a>
</li>
</ul>
</section>
<section id="prefooter">
<hr/>
<ul>
<li>
<div id="select-box-wrapper">
<div id="select-box">
<a class="padding">
Version:&nbsp;
<div class="select-style">
<select id="select-language" onchange="location = this.value;">
<option id="stable" value="https://www.eclipse.org/hono/docs/deployment/resource-limitation/" selected>stable (1.8)</option>
<option id="1.8" value="https://www.eclipse.org/hono/docs/1.8/deployment/resource-limitation/">1.8</option>
<option id="1.7" value="https://www.eclipse.org/hono/docs/1.7/deployment/resource-limitation/">1.7</option>
<option id="1.6" value="https://www.eclipse.org/hono/docs/1.6/deployment/resource-limitation/">1.6</option>
<option id="1.5" value="https://www.eclipse.org/hono/docs/1.5/deployment/resource-limitation/">1.5</option>
<option id="1.4" value="https://www.eclipse.org/hono/docs/1.4/deployment/resource-limitation/">1.4</option>
<option id="1.3" value="https://www.eclipse.org/hono/docs/1.3/deployment/resource-limitation/">1.3</option>
<option id="1.2" value="https://www.eclipse.org/hono/docs/1.2/deployment/resource-limitation/">1.2</option>
<option id="1.1" value="https://www.eclipse.org/hono/docs/1.1/deployment/resource-limitation/">1.1</option>
<option id="1.0" value="https://www.eclipse.org/hono/docs/1.0/deployment/resource-limitation/">1.0</option>
<option id="dev" value="https://www.eclipse.org/hono/docs/dev/deployment/resource-limitation/">dev</option>
</select>
<svg version="1.1" id="Capa_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
width="255px" height="255px" viewBox="0 0 255 255" style="enable-background:new 0 0 255 255;" xml:space="preserve">
<g>
<g id="arrow-drop-down">
<polygon points="0,63.75 127.5,191.25 255,63.75 " />
</g>
</g>
</svg>
</div>
</a>
</div>
</div>
</li>
</ul>
</section>
<section id="footer">
<p>&copy; 2021 <a href="https://www.eclipse.org/hono/">The Eclipse Hono Project</a></p>
<p>
Documentation built with
<a href="https://gohugo.io/" target="_blank">Hugo</a>
using the
<a href="https://github.com/matcornic/hugo-theme-learn" target="_blank">Learn</a> theme.
</p>
<div class="eclipse-logo">
<a href="https://www.eclipse.org" target="_blank">
<img src="https://www.eclipse.org/hono/docs/images/eclipse_foundation_logo.svg"/>
</a>
</div>
</section>
</div>
</nav>
<section id="body">
<div id="overlay"></div>
<div class="padding highlightable">
<div>
<div id="top-bar">
<div id="top-github-link">
<a class="github-link" title='Edit this page' href="https://github.com/eclipse/hono/edit/master/site/documentation/content/deployment/resource-limitation.md" target="blank">
<i class="fas fa-code-branch"></i>
<span id="top-github-link-text">Edit this page</span>
</a>
</div>
<div id="breadcrumbs" itemscope="" itemtype="http://data-vocabulary.org/Breadcrumb">
<span id="sidebar-toggle-span">
<a href="#" id="sidebar-toggle" data-sidebar-toggle="">
<i class="fas fa-bars"></i>
</a>
</span>
<span id="toc-menu"><i class="fas fa-list-alt"></i></span>
<span class="links">
<a href='/hono/docs/'>Documentation</a> > <a href='/hono/docs/deployment/'>Deployment</a> > Limiting Resource Usage
</span>
</div>
<div class="progress">
<div class="wrapper">
<nav id="TableOfContents">
<ul>
<li><a href="#javas-view-of-the-world">Java&rsquo;s View of the World</a></li>
<li><a href="#limiting-a-components-memory-consumption">Limiting a Component&rsquo;s Memory Consumption</a>
<ul>
<li><a href="#kubernetes">Kubernetes</a></li>
</ul>
</li>
<li><a href="#limiting-the-number-of-device-connections">Limiting the Number of Device Connections</a></li>
<li><a href="#limiting-the-overall-connection-time">Limiting the Overall Connection Time</a></li>
<li><a href="#limiting-the-data-volume">Limiting the Data Volume</a></li>
</ul>
</nav>
</div>
</div>
</div>
</div>
<div id="head-tags">
</div>
<div id="body-inner">
<h1>
Limiting Resource Usage
</h1>
<p>Deploying Eclipse Honoâ„¢ to a container orchestration platform is easy thanks to the provided Docker images. This page provides some guidance for configuring the resource consumption of these containers in order to make sure that they get enough memory and CPU to run properly, but to also make sure that individual containers do not use up all the resources causing other containers to starve.</p>
<p>Docker itself provides means to limit a container&rsquo;s consumption of memory and CPU resources by means of command line options that can be set when starting up a container. Both Kubernetes and OpenShift leverage this mechanism when defining resource limits of a <em>pod</em>. Please refer to the corresponding documentation of Docker, Kubernetes and OpenShift for details regarding the particular syntax to be used.</p>
<h2 id="javas-view-of-the-world">Java&rsquo;s View of the World</h2>
<p>Hono&rsquo;s service components are implemented in Java. When the corresponding Docker container for such a service is started, the only process being run inside the container is therefore a Java virtual machine (JVM). On startup, the JVM tries to determine the amount of memory and the number of CPU cores that it can use to execute workloads. By default the JVM queries the operating system for the corresponding parameters and adjusts its runtime parameters accordingly, e.g. it will by default limit the size of its heap memory to a quarter of the total memory available in order to leave enough memory for other processes running on the same system.</p>
<p>This is a reasonable approach when running on <em>bare metal</em> or a VM where other processes are expected to be running on the same machine, thus competing for the same computing resources. However, containers are usually configured to run a single process only so that it makes more sense to dedicate almost all of the available resources to running that process, leaving the (small) rest for the operating system itself.</p>
<p>As described above, a Docker container can easily be configured with a limit for memory and CPU resources that it may use during runtime. These limits are set and enforced using Linux <em>CGroups</em>.</p>
<h2 id="limiting-a-components-memory-consumption">Limiting a Component&rsquo;s Memory Consumption</h2>
<p>Starting with Java 9, the JVM will correctly determine the total memory and number of CPUs available when running inside of a container. All of the Docker images provided by Hono run with OpenJDK 11 by default, thus ensuring that the JVM considers any memory limits configured for the container when configuring its heap during startup. However, the default algorithm will still only allocate a quarter of the (limited) amount of memory, thus leaving a lot of memory available to the container unused.</p>
<p>The following JVM options can be used in Java 9 and later in order to change this behavior:</p>
<ul>
<li><code>-XX:MinRAMPercentage</code>, <code>-XX:MaxRAMPercentage</code> and <code>-XX:InitialRAMPercentage</code> can be used to set the (minimum, maximum and initial) percentage of total memory that may be allocated for the heap. A value of 70-80% should work if no other processes are running in the same container.</li>
</ul>
<h3 id="kubernetes">Kubernetes</h3>
<p>In Kubernetes (and OpenShift) the resource limits for a <em>pod</em>, and thus the container(s) that are part of the pod, can be configured in the corresponding <em>PodSpec</em>. The following example from the HTTP adapter&rsquo;s Kubernetes <em>Deployment</em> resource descriptor illustrates the mechanism:</p>
<div class="highlight"><pre style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-json" data-lang="json"><span style="color:#960050;background-color:#1e0010">apiVersion:</span> <span style="color:#960050;background-color:#1e0010">apps/v</span><span style="color:#ae81ff">1</span><span style="color:#960050;background-color:#1e0010">beta</span><span style="color:#ae81ff">1</span>
<span style="color:#960050;background-color:#1e0010">kind:</span> <span style="color:#960050;background-color:#1e0010">Deployment</span>
<span style="color:#960050;background-color:#1e0010">metadata:</span>
<span style="color:#960050;background-color:#1e0010">name:</span> <span style="color:#960050;background-color:#1e0010">hono-adapter-http-vertx</span>
<span style="color:#960050;background-color:#1e0010">spec:</span>
<span style="color:#960050;background-color:#1e0010">template:</span>
<span style="color:#960050;background-color:#1e0010">metadata:</span>
<span style="color:#960050;background-color:#1e0010">labels:</span>
<span style="color:#960050;background-color:#1e0010">app:</span> <span style="color:#960050;background-color:#1e0010">hono-adapter-http-vertx</span>
<span style="color:#960050;background-color:#1e0010">version:</span> <span style="color:#e6db74">&#34;${project.version}&#34;</span>
<span style="color:#960050;background-color:#1e0010">group:</span> <span style="color:#960050;background-color:#1e0010">$</span>{<span style="color:#960050;background-color:#1e0010">project.groupId</span>}
<span style="color:#960050;background-color:#1e0010">spec:</span>
<span style="color:#960050;background-color:#1e0010">containers:</span>
<span style="color:#960050;background-color:#1e0010">-</span> <span style="color:#960050;background-color:#1e0010">image:</span> <span style="color:#960050;background-color:#1e0010">eclipse/hono-adapter-http-vertx:$</span>{<span style="color:#960050;background-color:#1e0010">project.version</span>}
<span style="color:#960050;background-color:#1e0010">name:</span> <span style="color:#960050;background-color:#1e0010">eclipse-hono-adapter-http-vertx</span>
<span style="color:#960050;background-color:#1e0010">resources:</span>
<span style="color:#960050;background-color:#1e0010">limits:</span>
<span style="color:#960050;background-color:#1e0010">memory:</span> <span style="color:#e6db74">&#34;256Mi&#34;</span>
<span style="color:#960050;background-color:#1e0010">ports:</span>
<span style="color:#960050;background-color:#1e0010">-</span> <span style="color:#960050;background-color:#1e0010">containerPort:</span> <span style="color:#ae81ff">8080</span>
<span style="color:#960050;background-color:#1e0010">protocol:</span> <span style="color:#960050;background-color:#1e0010">TCP</span>
<span style="color:#960050;background-color:#1e0010">env:</span>
<span style="color:#960050;background-color:#1e0010">-</span> <span style="color:#960050;background-color:#1e0010">name:</span> <span style="color:#960050;background-color:#1e0010">SPRING_CONFIG_LOCATION</span>
<span style="color:#960050;background-color:#1e0010">value:</span> <span style="color:#960050;background-color:#1e0010">file:///etc/hono/</span>
<span style="color:#960050;background-color:#1e0010">-</span> <span style="color:#960050;background-color:#1e0010">name:</span> <span style="color:#960050;background-color:#1e0010">SPRING_PROFILES_ACTIVE</span>
<span style="color:#960050;background-color:#1e0010">value:</span> <span style="color:#960050;background-color:#1e0010">dev</span>
<span style="color:#960050;background-color:#1e0010">-</span> <span style="color:#960050;background-color:#1e0010">name:</span> <span style="color:#960050;background-color:#1e0010">LOGGING_CONFIG</span>
<span style="color:#960050;background-color:#1e0010">value:</span> <span style="color:#960050;background-color:#1e0010">classpath:logback-spring.xml</span>
<span style="color:#960050;background-color:#1e0010">-</span> <span style="color:#960050;background-color:#1e0010">name:</span> <span style="color:#960050;background-color:#1e0010">_JAVA_OPTIONS</span>
<span style="color:#960050;background-color:#1e0010">value:</span> <span style="color:#e6db74">&#34;-XX:MinRAMPercentage=80 -XX:MaxRAMPercentage=80&#34;</span>
<span style="color:#960050;background-color:#1e0010">volumeMounts:</span>
<span style="color:#960050;background-color:#1e0010">-</span> <span style="color:#960050;background-color:#1e0010">mountPath:</span> <span style="color:#960050;background-color:#1e0010">/etc/hono</span>
<span style="color:#960050;background-color:#1e0010">name:</span> <span style="color:#960050;background-color:#1e0010">conf</span>
<span style="color:#960050;background-color:#1e0010">readOnly:</span> <span style="color:#66d9ef">true</span>
<span style="color:#960050;background-color:#1e0010">volumes:</span>
<span style="color:#960050;background-color:#1e0010">-</span> <span style="color:#960050;background-color:#1e0010">name:</span> <span style="color:#960050;background-color:#1e0010">conf</span>
<span style="color:#960050;background-color:#1e0010">secret:</span>
<span style="color:#960050;background-color:#1e0010">secretName:</span> <span style="color:#960050;background-color:#1e0010">hono-adapter-http-vertx-conf</span>
</code></pre></div><p>The <code>resources</code> property defines the overall limit of 256 MB of memory that the pod may use. The <code>_JAVA_OPTIONS</code> environment variable is again used to configure the JVM to use 80% of the total memory for its heap.</p>
<h2 id="limiting-the-number-of-device-connections">Limiting the Number of Device Connections</h2>
<p>Hono supports limiting the overall number of simultaneously connected devices per tenant. Please refer to the <a href="/hono/docs/concepts/resource-limits/#connections-limit">connections limit concept</a> for more information. The limit needs to be configured at the tenant level using the <em>resource-limits</em> configuration property. Please refer to the <a href="/hono/docs/api/tenant/#tenant-information-format">Tenant API</a> for configuration details.</p>
<h2 id="limiting-the-overall-connection-time">Limiting the Overall Connection Time</h2>
<p>Hono supports configuring limits based on the overall amount of time that the devices have already been connected to protocol adapters for a tenant. Please refer to the <a href="/hono/docs/concepts/resource-limits/#connection-duration-limit">connection duration limit</a> for more information. Before accepting any connection requests from the devices, the protocol adapters verify that the configured connection duration limit is not exceeded. If the limit has been already reached, then the connection request is rejected. The limit needs to be configured at the tenant level using the <em>resource-limits</em> configuration property. Please refer to the <a href="/hono/docs/api/tenant/#tenant-information-format">Tenant API</a> for configuration details.</p>
<h2 id="limiting-the-data-volume">Limiting the Data Volume</h2>
<p>Hono supports limiting the amount of data that devices of a tenant can publish to Hono during a given time interval. Please refer to the <a href="/hono/docs/concepts/resource-limits/#messages-limit">messages limit concept</a> for more information. The limit needs to be configured at the tenant level using the <em>resource-limits</em> configuration property. Please refer to the <a href="/hono/docs/api/tenant/#tenant-information-format">Tenant API</a> for configuration details.</p>
<footer class="footline">
</footer>
</div>
</div>
<div id="navigation">
</div>
</section>
<div style="left: -1000px; overflow: scroll; position: absolute; top: -1000px; border: none; box-sizing: content-box; height: 200px; margin: 0px; padding: 0px; width: 200px;">
<div style="border: none; box-sizing: content-box; height: 200px; margin: 0px; padding: 0px; width: 200px;"></div>
</div>
<script src="/hono/docs/js/clipboard.min.js?1626138715"></script>
<script src="/hono/docs/js/perfect-scrollbar.min.js?1626138715"></script>
<script src="/hono/docs/js/perfect-scrollbar.jquery.min.js?1626138715"></script>
<script src="/hono/docs/js/jquery.sticky.js?1626138715"></script>
<script src="/hono/docs/js/featherlight.min.js?1626138715"></script>
<script src="/hono/docs/js/highlight.pack.js?1626138715"></script>
<script>hljs.initHighlightingOnLoad();</script>
<script src="/hono/docs/js/modernizr.custom-3.6.0.js?1626138715"></script>
<script src="/hono/docs/js/learn.js?1626138715"></script>
<script src="/hono/docs/js/hugo-learn.js?1626138715"></script>
<link href="/hono/docs/mermaid/mermaid.css?1626138715" rel="stylesheet" />
<script src="/hono/docs/mermaid/mermaid.js?1626138715"></script>
<script>
mermaid.initialize({ startOnLoad: true });
</script>
<script>
(function(w,d,s,l,i){w[l]=w[l]||[];w[l].push({'gtm.start':
new Date().getTime(),event:'gtm.js'});var f=d.getElementsByTagName(s)[0],
j=d.createElement(s),dl=l!='dataLayer'?'&l='+l:'';j.async=true;j.src=
'https://www.googletagmanager.com/gtm.js?id='+i+dl;f.parentNode.insertBefore(j,f);
})(window,document,'script','dataLayer','GTM-5WLCZXC');
</script>
<script src="https://www.eclipse.org/eclipse.org-common/themes/solstice/public/javascript/vendor/cookieconsent/default.min.js"></script>
</body>
</html>