├── requirements.txt ├── Procfile ├── static └── logo.png ├── heroku_setup.sh ├── README.md ├── .devcontainer ├── Dockerfile └── devcontainer.json ├── .gitignore ├── LICENSE ├── app.py └── calculator.ipynb /requirements.txt: -------------------------------------------------------------------------------- 1 | streamlit -------------------------------------------------------------------------------- /Procfile: -------------------------------------------------------------------------------- 1 | web: sh heroku_setup.sh && streamlit run app.py -------------------------------------------------------------------------------- /static/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/netdata/netdata-storage-calculator/main/static/logo.png -------------------------------------------------------------------------------- /heroku_setup.sh: -------------------------------------------------------------------------------- 1 | mkdir -p ~/.streamlit/ 2 | 3 | echo "\ 4 | [server]\n\ 5 | headless = true\n\ 6 | enableCORS=false\n\ 7 | port = $PORT\n\ 8 | " > ~/.streamlit/config.toml -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Netdata Storage Calculator 2 | 3 | A little [streamlit](https://streamlit.io/) based app used for estimating Netdata storage requirements. 4 | 5 | Read Netdata documentation [here](https://learn.netdata.cloud/docs/store/change-metrics-storage). 6 | 7 | App is available at https://netdata-storage-calculator.herokuapp.com/ 8 | 9 | You can also run the [calculator](/calculator.ipynb) notebook in google colab by pressing "Open in Colab". 10 | 11 | ## Development 12 | 13 | The recommended way to work on this is in a GitHub Codespace. The `.devcontainer/` folder defines what will be installed into that codespace and should have everything you need. 14 | 15 | ```bash 16 | # run app in development mode 17 | streamlit run app.py 18 | ``` -------------------------------------------------------------------------------- /.devcontainer/Dockerfile: -------------------------------------------------------------------------------- 1 | # See here for image contents: https://github.com/microsoft/vscode-dev-containers/tree/v0.209.6/containers/python-3/.devcontainer/base.Dockerfile 2 | 3 | # [Choice] Python version (use -bullseye variants on local arm64/Apple Silicon): 3, 3.10, 3.9, 3.8, 3.7, 3.6, 3-bullseye, 3.10-bullseye, 3.9-bullseye, 3.8-bullseye, 3.7-bullseye, 3.6-bullseye, 3-buster, 3.10-buster, 3.9-buster, 3.8-buster, 3.7-buster, 3.6-buster 4 | ARG VARIANT="3.10-bullseye" 5 | FROM mcr.microsoft.com/vscode/devcontainers/python:0-${VARIANT} 6 | 7 | ENV PATH="/home/vscode/.local/bin:${PATH}" 8 | 9 | # [Optional] Uncomment this section to install additional OS packages. 10 | # RUN apt-get update && export DEBIAN_FRONTEND=noninteractive \ 11 | # && apt-get -y install --no-install-recommends -------------------------------------------------------------------------------- /.devcontainer/devcontainer.json: -------------------------------------------------------------------------------- 1 | // For format details, see https://aka.ms/devcontainer.json. For config options, see the README at: 2 | // https://github.com/microsoft/vscode-dev-containers/tree/v0.209.6/containers/python-3 3 | { 4 | "name": "Python 3", 5 | "build": { 6 | "dockerfile": "Dockerfile", 7 | "context": "..", 8 | "args": { 9 | // Update 'VARIANT' to pick a Python version: 3, 3.10, 3.9, 3.8, 3.7, 3.6 10 | // Append -bullseye or -buster to pin to an OS version. 11 | // Use -bullseye variants on local on arm64/Apple Silicon. 12 | "VARIANT": "3.7", 13 | } 14 | }, 15 | // Set *default* container specific settings.json values on container create. 16 | "settings": { 17 | "python.defaultInterpreterPath": "/usr/local/bin/python", 18 | }, 19 | // Add the IDs of extensions you want installed when the container is created. 20 | "extensions": [ 21 | "ms-python.python", 22 | "ms-python.vscode-pylance" 23 | ], 24 | // Use 'forwardPorts' to make a list of ports inside the container available locally. 25 | "forwardPorts": [ 26 | 8501 27 | ], 28 | // Use 'postCreateCommand' to run commands after the container is created. 29 | // Install NPM dependencies. 30 | "postCreateCommand": "pip install -U streamlit", 31 | // Comment out connect as root instead. More info: https://aka.ms/vscode-remote/containers/non-root. 32 | "remoteUser": "vscode", 33 | "features": { 34 | "git": "latest", 35 | "github-cli": "latest" 36 | } 37 | } -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Byte-compiled / optimized / DLL files 2 | __pycache__/ 3 | *.py[cod] 4 | *$py.class 5 | 6 | # C extensions 7 | *.so 8 | 9 | # Distribution / packaging 10 | .Python 11 | build/ 12 | develop-eggs/ 13 | dist/ 14 | downloads/ 15 | eggs/ 16 | .eggs/ 17 | lib/ 18 | lib64/ 19 | parts/ 20 | sdist/ 21 | var/ 22 | wheels/ 23 | pip-wheel-metadata/ 24 | share/python-wheels/ 25 | *.egg-info/ 26 | .installed.cfg 27 | *.egg 28 | MANIFEST 29 | 30 | # PyInstaller 31 | # Usually these files are written by a python script from a template 32 | # before PyInstaller builds the exe, so as to inject date/other infos into it. 33 | *.manifest 34 | *.spec 35 | 36 | # Installer logs 37 | pip-log.txt 38 | pip-delete-this-directory.txt 39 | 40 | # Unit test / coverage reports 41 | htmlcov/ 42 | .tox/ 43 | .nox/ 44 | .coverage 45 | .coverage.* 46 | .cache 47 | nosetests.xml 48 | coverage.xml 49 | *.cover 50 | *.py,cover 51 | .hypothesis/ 52 | .pytest_cache/ 53 | 54 | # Translations 55 | *.mo 56 | *.pot 57 | 58 | # Django stuff: 59 | *.log 60 | local_settings.py 61 | db.sqlite3 62 | db.sqlite3-journal 63 | 64 | # Flask stuff: 65 | instance/ 66 | .webassets-cache 67 | 68 | # Scrapy stuff: 69 | .scrapy 70 | 71 | # Sphinx documentation 72 | docs/_build/ 73 | 74 | # PyBuilder 75 | target/ 76 | 77 | # Jupyter Notebook 78 | .ipynb_checkpoints 79 | 80 | # IPython 81 | profile_default/ 82 | ipython_config.py 83 | 84 | # pyenv 85 | .python-version 86 | 87 | # pipenv 88 | # According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control. 89 | # However, in case of collaboration, if having platform-specific dependencies or dependencies 90 | # having no cross-platform support, pipenv may install dependencies that don't work, or not 91 | # install all needed dependencies. 92 | #Pipfile.lock 93 | 94 | # PEP 582; used by e.g. github.com/David-OConnor/pyflow 95 | __pypackages__/ 96 | 97 | # Celery stuff 98 | celerybeat-schedule 99 | celerybeat.pid 100 | 101 | # SageMath parsed files 102 | *.sage.py 103 | 104 | # Environments 105 | .env 106 | .venv 107 | env/ 108 | venv/ 109 | ENV/ 110 | env.bak/ 111 | venv.bak/ 112 | 113 | # Spyder project settings 114 | .spyderproject 115 | .spyproject 116 | 117 | # Rope project settings 118 | .ropeproject 119 | 120 | # mkdocs documentation 121 | /site 122 | 123 | # mypy 124 | .mypy_cache/ 125 | .dmypy.json 126 | dmypy.json 127 | 128 | # Pyre type checker 129 | .pyre/ 130 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | Apache License 2 | Version 2.0, January 2004 3 | http://www.apache.org/licenses/ 4 | 5 | TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION 6 | 7 | 1. Definitions. 8 | 9 | "License" shall mean the terms and conditions for use, reproduction, 10 | and distribution as defined by Sections 1 through 9 of this document. 11 | 12 | "Licensor" shall mean the copyright owner or entity authorized by 13 | the copyright owner that is granting the License. 14 | 15 | "Legal Entity" shall mean the union of the acting entity and all 16 | other entities that control, are controlled by, or are under common 17 | control with that entity. For the purposes of this definition, 18 | "control" means (i) the power, direct or indirect, to cause the 19 | direction or management of such entity, whether by contract or 20 | otherwise, or (ii) ownership of fifty percent (50%) or more of the 21 | outstanding shares, or (iii) beneficial ownership of such entity. 22 | 23 | "You" (or "Your") shall mean an individual or Legal Entity 24 | exercising permissions granted by this License. 25 | 26 | "Source" form shall mean the preferred form for making modifications, 27 | including but not limited to software source code, documentation 28 | source, and configuration files. 29 | 30 | "Object" form shall mean any form resulting from mechanical 31 | transformation or translation of a Source form, including but 32 | not limited to compiled object code, generated documentation, 33 | and conversions to other media types. 34 | 35 | "Work" shall mean the work of authorship, whether in Source or 36 | Object form, made available under the License, as indicated by a 37 | copyright notice that is included in or attached to the work 38 | (an example is provided in the Appendix below). 39 | 40 | "Derivative Works" shall mean any work, whether in Source or Object 41 | form, that is based on (or derived from) the Work and for which the 42 | editorial revisions, annotations, elaborations, or other modifications 43 | represent, as a whole, an original work of authorship. For the purposes 44 | of this License, Derivative Works shall not include works that remain 45 | separable from, or merely link (or bind by name) to the interfaces of, 46 | the Work and Derivative Works thereof. 47 | 48 | "Contribution" shall mean any work of authorship, including 49 | the original version of the Work and any modifications or additions 50 | to that Work or Derivative Works thereof, that is intentionally 51 | submitted to Licensor for inclusion in the Work by the copyright owner 52 | or by an individual or Legal Entity authorized to submit on behalf of 53 | the copyright owner. For the purposes of this definition, "submitted" 54 | means any form of electronic, verbal, or written communication sent 55 | to the Licensor or its representatives, including but not limited to 56 | communication on electronic mailing lists, source code control systems, 57 | and issue tracking systems that are managed by, or on behalf of, the 58 | Licensor for the purpose of discussing and improving the Work, but 59 | excluding communication that is conspicuously marked or otherwise 60 | designated in writing by the copyright owner as "Not a Contribution." 61 | 62 | "Contributor" shall mean Licensor and any individual or Legal Entity 63 | on behalf of whom a Contribution has been received by Licensor and 64 | subsequently incorporated within the Work. 65 | 66 | 2. Grant of Copyright License. Subject to the terms and conditions of 67 | this License, each Contributor hereby grants to You a perpetual, 68 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 69 | copyright license to reproduce, prepare Derivative Works of, 70 | publicly display, publicly perform, sublicense, and distribute the 71 | Work and such Derivative Works in Source or Object form. 72 | 73 | 3. Grant of Patent License. Subject to the terms and conditions of 74 | this License, each Contributor hereby grants to You a perpetual, 75 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 76 | (except as stated in this section) patent license to make, have made, 77 | use, offer to sell, sell, import, and otherwise transfer the Work, 78 | where such license applies only to those patent claims licensable 79 | by such Contributor that are necessarily infringed by their 80 | Contribution(s) alone or by combination of their Contribution(s) 81 | with the Work to which such Contribution(s) was submitted. If You 82 | institute patent litigation against any entity (including a 83 | cross-claim or counterclaim in a lawsuit) alleging that the Work 84 | or a Contribution incorporated within the Work constitutes direct 85 | or contributory patent infringement, then any patent licenses 86 | granted to You under this License for that Work shall terminate 87 | as of the date such litigation is filed. 88 | 89 | 4. Redistribution. You may reproduce and distribute copies of the 90 | Work or Derivative Works thereof in any medium, with or without 91 | modifications, and in Source or Object form, provided that You 92 | meet the following conditions: 93 | 94 | (a) You must give any other recipients of the Work or 95 | Derivative Works a copy of this License; and 96 | 97 | (b) You must cause any modified files to carry prominent notices 98 | stating that You changed the files; and 99 | 100 | (c) You must retain, in the Source form of any Derivative Works 101 | that You distribute, all copyright, patent, trademark, and 102 | attribution notices from the Source form of the Work, 103 | excluding those notices that do not pertain to any part of 104 | the Derivative Works; and 105 | 106 | (d) If the Work includes a "NOTICE" text file as part of its 107 | distribution, then any Derivative Works that You distribute must 108 | include a readable copy of the attribution notices contained 109 | within such NOTICE file, excluding those notices that do not 110 | pertain to any part of the Derivative Works, in at least one 111 | of the following places: within a NOTICE text file distributed 112 | as part of the Derivative Works; within the Source form or 113 | documentation, if provided along with the Derivative Works; or, 114 | within a display generated by the Derivative Works, if and 115 | wherever such third-party notices normally appear. The contents 116 | of the NOTICE file are for informational purposes only and 117 | do not modify the License. You may add Your own attribution 118 | notices within Derivative Works that You distribute, alongside 119 | or as an addendum to the NOTICE text from the Work, provided 120 | that such additional attribution notices cannot be construed 121 | as modifying the License. 122 | 123 | You may add Your own copyright statement to Your modifications and 124 | may provide additional or different license terms and conditions 125 | for use, reproduction, or distribution of Your modifications, or 126 | for any such Derivative Works as a whole, provided Your use, 127 | reproduction, and distribution of the Work otherwise complies with 128 | the conditions stated in this License. 129 | 130 | 5. Submission of Contributions. Unless You explicitly state otherwise, 131 | any Contribution intentionally submitted for inclusion in the Work 132 | by You to the Licensor shall be under the terms and conditions of 133 | this License, without any additional terms or conditions. 134 | Notwithstanding the above, nothing herein shall supersede or modify 135 | the terms of any separate license agreement you may have executed 136 | with Licensor regarding such Contributions. 137 | 138 | 6. Trademarks. This License does not grant permission to use the trade 139 | names, trademarks, service marks, or product names of the Licensor, 140 | except as required for reasonable and customary use in describing the 141 | origin of the Work and reproducing the content of the NOTICE file. 142 | 143 | 7. Disclaimer of Warranty. Unless required by applicable law or 144 | agreed to in writing, Licensor provides the Work (and each 145 | Contributor provides its Contributions) on an "AS IS" BASIS, 146 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 147 | implied, including, without limitation, any warranties or conditions 148 | of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A 149 | PARTICULAR PURPOSE. You are solely responsible for determining the 150 | appropriateness of using or redistributing the Work and assume any 151 | risks associated with Your exercise of permissions under this License. 152 | 153 | 8. Limitation of Liability. In no event and under no legal theory, 154 | whether in tort (including negligence), contract, or otherwise, 155 | unless required by applicable law (such as deliberate and grossly 156 | negligent acts) or agreed to in writing, shall any Contributor be 157 | liable to You for damages, including any direct, indirect, special, 158 | incidental, or consequential damages of any character arising as a 159 | result of this License or out of the use or inability to use the 160 | Work (including but not limited to damages for loss of goodwill, 161 | work stoppage, computer failure or malfunction, or any and all 162 | other commercial damages or losses), even if such Contributor 163 | has been advised of the possibility of such damages. 164 | 165 | 9. Accepting Warranty or Additional Liability. While redistributing 166 | the Work or Derivative Works thereof, You may choose to offer, 167 | and charge a fee for, acceptance of support, warranty, indemnity, 168 | or other liability obligations and/or rights consistent with this 169 | License. However, in accepting such obligations, You may act only 170 | on Your own behalf and on Your sole responsibility, not on behalf 171 | of any other Contributor, and only if You agree to indemnify, 172 | defend, and hold each Contributor harmless for any liability 173 | incurred by, or claims asserted against, such Contributor by reason 174 | of your accepting any such warranty or additional liability. 175 | 176 | END OF TERMS AND CONDITIONS 177 | 178 | APPENDIX: How to apply the Apache License to your work. 179 | 180 | To apply the Apache License to your work, attach the following 181 | boilerplate notice, with the fields enclosed by brackets "[]" 182 | replaced with your own identifying information. (Don't include 183 | the brackets!) The text should be enclosed in the appropriate 184 | comment syntax for the file format. We also recommend that a 185 | file or class name and description of purpose be included on the 186 | same "printed page" as the copyright notice for easier 187 | identification within third-party archives. 188 | 189 | Copyright [yyyy] [name of copyright owner] 190 | 191 | Licensed under the Apache License, Version 2.0 (the "License"); 192 | you may not use this file except in compliance with the License. 193 | You may obtain a copy of the License at 194 | 195 | http://www.apache.org/licenses/LICENSE-2.0 196 | 197 | Unless required by applicable law or agreed to in writing, software 198 | distributed under the License is distributed on an "AS IS" BASIS, 199 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 200 | See the License for the specific language governing permissions and 201 | limitations under the License. 202 | -------------------------------------------------------------------------------- /app.py: -------------------------------------------------------------------------------- 1 | #%% 2 | 3 | import streamlit as st 4 | 5 | #%% 6 | 7 | ############################ 8 | # constants 9 | ############################ 10 | 11 | PER_METRIC_BYTES_64BIT = 165 12 | PER_PAGE_BYTES_64BIT = 90 13 | PER_EXTENT_BYTES_64BIT = 32 14 | PER_FILE_BYTES_64BIT = 88 15 | CACHE_OVERHEAD_PER_PAGE_BYTES_64BIT = 144 16 | DISK_OVERHEAD_PERCENTAGE_64BIT = 0.11 17 | TIER_EVERY_ITERATIONS = 60 18 | COMPRESSION_DECREASE_PER_TIER = 0.1 19 | EPHEMERAL_METRICS_PER_DAY = 0.05 20 | BYTES_PER_METRIC_TIER_0 = 4 21 | BYTES_PER_METRIC_TIER_1 = 16 22 | BYTES_PER_METRIC_TIER_2 = 16 23 | PAGE_SIZE_TIER_0 = 16384 24 | PAGE_SIZE_TIER_1 = 8192 25 | PAGE_SIZE_TIER_2 = 4096 26 | PAGES_PER_EXTENT_TIER_0 = 4 27 | PAGES_PER_EXTENT_TIER_1 = 8 28 | PAGES_PER_EXTENT_TIER_2 = 16 29 | COMPRESSION_SAVINGS_TIER_0 = 0.7 30 | COMPRESSION_SAVINGS_TIER_1 = 0.7 31 | COMPRESSION_SAVINGS_TIER_2 = 0.7 32 | 33 | #%% 34 | 35 | # title & logo 36 | st.image('static/logo.png', width=400) 37 | st.header('Netdata Storage Calculator') 38 | 39 | # description 40 | description = """ 41 | Experiment with the inputs below to come up with the best settings for your use case. 42 | 43 | Be sure to [read the docs](https://learn.netdata.cloud/docs/store/change-metrics-storage) first. 44 | 45 | Note: A Python notebook version of the calculator can be found [here](https://github.com/netdata/netdata-storage-calculator/blob/main/calculator.ipynb) if you would like to customize it or easily step through the calculations. 46 | """ 47 | st.markdown(description) 48 | 49 | ############################ 50 | # inputs 51 | ############################ 52 | 53 | st.subheader('Inputs') 54 | 55 | # average_concurrent_metrics 56 | average_concurrent_metrics = st.number_input('average concurrent metrics', value=2500, help='') 57 | 58 | # maximum_disk_size_mb 59 | c1r1, c2r1, c3r1 = st.columns(3) 60 | maximum_disk_size_mb_tier_0 = c1r1.number_input('maximum disk size (MB) - Tier 0', value=1024, help='') 61 | maximum_disk_size_mb_tier_1 = c2r1.number_input('maximum disk size (MB) - Tier 1', value=384, help='') 62 | maximum_disk_size_mb_tier_2 = c3r1.number_input('maximum disk size (MB) - Tier 2', value=192, help='') 63 | 64 | # update_every_sec 65 | c1r2, c2r2, c3r2 = st.columns(3) 66 | update_every_sec_tier_0 = c1r2.number_input('update every (sec) - Tier 0', value=1, help='') 67 | update_every_sec_tier_1 = c2r2.number_input('update every (sec) - Tier 1', value=60, help='') 68 | update_every_sec_tier_2 = c3r2.number_input('update every (sec) - Tier 2', value=3600, help='') 69 | 70 | # page_cache_size_mb 71 | c1r3, c2r3, c3r3 = st.columns(3) 72 | page_cache_size_mb_tier_0 = c1r3.number_input('page cache size (MB) - Tier 0', value=64, help='') 73 | page_cache_size_mb_tier_1 = c2r3.number_input('page cache size (MB) - Tier 1', value=36, help='') 74 | page_cache_size_mb_tier_2 = c3r3.number_input('page cache size (MB) - Tier 2', value=36, help='') 75 | 76 | #%% 77 | 78 | ############################ 79 | # calculations 80 | ############################ 81 | 82 | observed_average_granularity_secs_tier_0 = update_every_sec_tier_0 * 1.2 83 | observed_average_granularity_secs_tier_1 = update_every_sec_tier_1 * 1.2 84 | observed_average_granularity_secs_tier_2 = update_every_sec_tier_2 * 1.2 85 | 86 | page_cache_size_in_bytes_tier_0 = page_cache_size_mb_tier_0 * 1024 * 1024 87 | page_cache_size_in_bytes_tier_1 = page_cache_size_mb_tier_1 * 1024 * 1024 88 | page_cache_size_in_bytes_tier_2 = page_cache_size_mb_tier_2 * 1024 * 1024 89 | 90 | max_full_pages_in_cache_tier_0 = page_cache_size_in_bytes_tier_0 / PAGE_SIZE_TIER_0 91 | max_full_pages_in_cache_tier_1 = page_cache_size_in_bytes_tier_1 / PAGE_SIZE_TIER_1 92 | max_full_pages_in_cache_tier_2 = page_cache_size_in_bytes_tier_2 / PAGE_SIZE_TIER_2 93 | 94 | cache_overhead_in_bytes_tier_0 = max_full_pages_in_cache_tier_0 * CACHE_OVERHEAD_PER_PAGE_BYTES_64BIT 95 | cache_overhead_in_bytes_tier_1 = max_full_pages_in_cache_tier_1 * CACHE_OVERHEAD_PER_PAGE_BYTES_64BIT 96 | cache_overhead_in_bytes_tier_2 = max_full_pages_in_cache_tier_2 * CACHE_OVERHEAD_PER_PAGE_BYTES_64BIT 97 | 98 | total_page_cache_bytes_tier_0 = page_cache_size_in_bytes_tier_0 + cache_overhead_in_bytes_tier_0 99 | total_page_cache_bytes_tier_1 = page_cache_size_in_bytes_tier_1 + cache_overhead_in_bytes_tier_1 100 | total_page_cache_bytes_tier_2 = page_cache_size_in_bytes_tier_2 + cache_overhead_in_bytes_tier_2 101 | 102 | uncompressed_disk_size_tier_0 = (maximum_disk_size_mb_tier_0 * (1 - DISK_OVERHEAD_PERCENTAGE_64BIT) * 1024 * 1024) / (1 - COMPRESSION_SAVINGS_TIER_0) 103 | uncompressed_disk_size_tier_1 = (maximum_disk_size_mb_tier_1 * (1 - DISK_OVERHEAD_PERCENTAGE_64BIT) * 1024 * 1024) / (1 - COMPRESSION_SAVINGS_TIER_1) 104 | uncompressed_disk_size_tier_2 = (maximum_disk_size_mb_tier_2 * (1 - DISK_OVERHEAD_PERCENTAGE_64BIT) * 1024 * 1024) / (1 - COMPRESSION_SAVINGS_TIER_2) 105 | 106 | pages_tier_0 = uncompressed_disk_size_tier_0 / PAGE_SIZE_TIER_0 107 | pages_tier_1 = uncompressed_disk_size_tier_1 / PAGE_SIZE_TIER_1 108 | pages_tier_2 = uncompressed_disk_size_tier_2 / PAGE_SIZE_TIER_2 109 | 110 | extents_tier_0 = pages_tier_0 / PAGES_PER_EXTENT_TIER_0 111 | extents_tier_1 = pages_tier_1 / PAGES_PER_EXTENT_TIER_1 112 | extents_tier_2 = pages_tier_2 / PAGES_PER_EXTENT_TIER_2 113 | 114 | total_points_in_the_database_tier_0 = uncompressed_disk_size_tier_0 / BYTES_PER_METRIC_TIER_0 115 | total_points_in_the_database_tier_1 = uncompressed_disk_size_tier_1 / BYTES_PER_METRIC_TIER_1 116 | total_points_in_the_database_tier_2 = uncompressed_disk_size_tier_2 / BYTES_PER_METRIC_TIER_2 117 | 118 | points_for_a_full_retention_metric_tier_0 = total_points_in_the_database_tier_0 / average_concurrent_metrics 119 | points_for_a_full_retention_metric_tier_1 = total_points_in_the_database_tier_1 / average_concurrent_metrics 120 | points_for_a_full_retention_metric_tier_2 = total_points_in_the_database_tier_2 / average_concurrent_metrics 121 | 122 | metric_retention_secs_tier_0 = points_for_a_full_retention_metric_tier_0 * observed_average_granularity_secs_tier_0 123 | metric_retention_secs_tier_1 = points_for_a_full_retention_metric_tier_1 * observed_average_granularity_secs_tier_1 124 | metric_retention_secs_tier_2 = points_for_a_full_retention_metric_tier_2 * observed_average_granularity_secs_tier_2 125 | 126 | metric_retention_hours_tier_0 = metric_retention_secs_tier_0 / 60 / 60 127 | metric_retention_hours_tier_1 = metric_retention_secs_tier_1 / 60 / 60 128 | metric_retention_hours_tier_2 = metric_retention_secs_tier_2 / 60 / 60 129 | 130 | metric_retention_days_tier_0 = metric_retention_hours_tier_0 / 24 131 | metric_retention_days_tier_1 = metric_retention_hours_tier_1 / 24 132 | metric_retention_days_tier_2 = metric_retention_hours_tier_2 / 24 133 | 134 | maximum_number_of_unique_metrics_tier_0 = average_concurrent_metrics + (average_concurrent_metrics * EPHEMERAL_METRICS_PER_DAY * metric_retention_days_tier_0) 135 | maximum_number_of_unique_metrics_tier_1 = average_concurrent_metrics + (average_concurrent_metrics * EPHEMERAL_METRICS_PER_DAY * metric_retention_days_tier_1) 136 | maximum_number_of_unique_metrics_tier_2 = average_concurrent_metrics + (average_concurrent_metrics * EPHEMERAL_METRICS_PER_DAY * metric_retention_days_tier_2) 137 | 138 | metrics_structures_bytes_tier_0 = (maximum_number_of_unique_metrics_tier_0 * PER_METRIC_BYTES_64BIT) if maximum_disk_size_mb_tier_0 > 0 else 0 139 | metrics_structures_bytes_tier_1 = (maximum_number_of_unique_metrics_tier_1 * PER_METRIC_BYTES_64BIT) if maximum_disk_size_mb_tier_1 > 0 else 0 140 | metrics_structures_bytes_tier_2 = (maximum_number_of_unique_metrics_tier_2 * PER_METRIC_BYTES_64BIT) if maximum_disk_size_mb_tier_2 > 0 else 0 141 | 142 | pages_structures_bytes_tier_0 = pages_tier_0 * PER_PAGE_BYTES_64BIT 143 | pages_structures_bytes_tier_1 = pages_tier_1 * PER_PAGE_BYTES_64BIT 144 | pages_structures_bytes_tier_2 = pages_tier_2 * PER_PAGE_BYTES_64BIT 145 | 146 | extents_structures_bytes_tier_0 = extents_tier_0 * PER_EXTENT_BYTES_64BIT 147 | extents_structures_bytes_tier_1 = extents_tier_1 * PER_EXTENT_BYTES_64BIT 148 | extents_structures_bytes_tier_2 = extents_tier_2 * PER_EXTENT_BYTES_64BIT 149 | 150 | dbengine_index_memory_mb_tier_0 = (metrics_structures_bytes_tier_0 + pages_structures_bytes_tier_0 + extents_structures_bytes_tier_0) / 1024 / 1024 151 | dbengine_index_memory_mb_tier_1 = (metrics_structures_bytes_tier_1 + pages_structures_bytes_tier_1 + extents_structures_bytes_tier_1) / 1024 / 1024 152 | dbengine_index_memory_mb_tier_2 = (metrics_structures_bytes_tier_2 + pages_structures_bytes_tier_2 + extents_structures_bytes_tier_2) / 1024 / 1024 153 | 154 | collectors_memory_mb_tier_0 = (PAGE_SIZE_TIER_0 * average_concurrent_metrics) / 1024 / 1024 155 | collectors_memory_mb_tier_1 = (PAGE_SIZE_TIER_1 * average_concurrent_metrics) / 1024 / 1024 156 | collectors_memory_mb_tier_2 = (PAGE_SIZE_TIER_2 * average_concurrent_metrics) / 1024 / 1024 157 | 158 | final_page_cache_size_in_mb_tier_0 = total_page_cache_bytes_tier_0 / 1024 / 1024 159 | final_page_cache_size_in_mb_tier_1 = total_page_cache_bytes_tier_1 / 1024 / 1024 160 | final_page_cache_size_in_mb_tier_2 = total_page_cache_bytes_tier_2 / 1024 / 1024 161 | 162 | total_ram_memory_mb_tier_0 = dbengine_index_memory_mb_tier_0 + collectors_memory_mb_tier_0 + final_page_cache_size_in_mb_tier_0 163 | total_ram_memory_mb_tier_1 = dbengine_index_memory_mb_tier_1 + collectors_memory_mb_tier_1 + final_page_cache_size_in_mb_tier_1 164 | total_ram_memory_mb_tier_2 = dbengine_index_memory_mb_tier_2 + collectors_memory_mb_tier_2 + final_page_cache_size_in_mb_tier_2 165 | 166 | ############################ 167 | # estimated outputs 168 | ############################ 169 | 170 | estimated_data_points_stored = total_points_in_the_database_tier_0 + total_points_in_the_database_tier_1 + total_points_in_the_database_tier_2 171 | estimated_points_per_metric = points_for_a_full_retention_metric_tier_0 + points_for_a_full_retention_metric_tier_1 + points_for_a_full_retention_metric_tier_2 172 | estimated_maximum_days = metric_retention_days_tier_2 173 | estimated_disk_storage_gb = (maximum_disk_size_mb_tier_0 + maximum_disk_size_mb_tier_1 + maximum_disk_size_mb_tier_2) / 1024 174 | estimated_ram_mb = total_ram_memory_mb_tier_0 + total_ram_memory_mb_tier_1 + total_ram_memory_mb_tier_2 175 | estimated_dbengine_tier_1_update_every_iterations = update_every_sec_tier_1 / update_every_sec_tier_0 176 | estimated_dbengine_tier_2_update_every_iterations = update_every_sec_tier_2 / update_every_sec_tier_1 177 | 178 | #%% 179 | 180 | ############################ 181 | # outputs 182 | ############################ 183 | 184 | st.subheader('Outputs') 185 | 186 | output_message = f'Netdata will store an estimated **{round(estimated_data_points_stored):000,}** data points (**{round(estimated_points_per_metric):000,} points/metric**) ' 187 | output_message += f'for a maximum of **{round(estimated_maximum_days):000,} days**, utilizing **{round(estimated_disk_storage_gb,2):000,} GB** of disk storage ' 188 | output_message += f'and **{round(estimated_ram_mb):000,} MB** of RAM ' 189 | output_message += f'for a maximum of **{round(metric_retention_days_tier_0):000,} days (T0)**, **{round(metric_retention_days_tier_1):000,} days (T1)**, **{round(metric_retention_days_tier_2):000,} days (T2)**.' 190 | 191 | output_netdata_conf = f""" 192 | # Enter the following in your agent's netdata.conf 193 | [db] 194 | mode = dbengine 195 | storage tiers = 3 196 | update every = {update_every_sec_tier_0} 197 | dbengine multihost disk space MB = {maximum_disk_size_mb_tier_0} 198 | dbengine page cache size MB = {page_cache_size_mb_tier_0} 199 | dbengine tier 1 update every iterations = {round(estimated_dbengine_tier_1_update_every_iterations)} 200 | dbengine tier 1 multihost disk space MB = {maximum_disk_size_mb_tier_1} 201 | dbengine tier 1 page cache size MB = {page_cache_size_mb_tier_1} 202 | dbengine tier 2 update every iterations = {round(estimated_dbengine_tier_2_update_every_iterations)} 203 | dbengine tier 2 multihost disk space MB = {maximum_disk_size_mb_tier_2} 204 | dbengine tier 2 page cache size MB = {page_cache_size_mb_tier_2} 205 | """ 206 | 207 | # message 208 | st.write(output_message) 209 | 210 | # conf 211 | st.code(output_netdata_conf, language='ini') 212 | 213 | #%% 214 | -------------------------------------------------------------------------------- /calculator.ipynb: -------------------------------------------------------------------------------- 1 | { 2 | "cells": [ 3 | { 4 | "cell_type": "markdown", 5 | "metadata": {}, 6 | "source": [ 7 | "[![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/andrewm4894/netdata-storage-calculator/blob/main/calculator.ipynb)" 8 | ] 9 | }, 10 | { 11 | "cell_type": "code", 12 | "execution_count": 8, 13 | "metadata": {}, 14 | "outputs": [], 15 | "source": [ 16 | "from IPython.display import Markdown as md" 17 | ] 18 | }, 19 | { 20 | "cell_type": "code", 21 | "execution_count": 9, 22 | "metadata": {}, 23 | "outputs": [], 24 | "source": [ 25 | "############################\n", 26 | "# inputs\n", 27 | "############################\n", 28 | "\n", 29 | "# average_concurrent_metrics\n", 30 | "average_concurrent_metrics = 2500\n", 31 | "\n", 32 | "# maximum_disk_size_mb\n", 33 | "maximum_disk_size_mb_tier_0 = 1024\n", 34 | "maximum_disk_size_mb_tier_1 = 384\n", 35 | "maximum_disk_size_mb_tier_2 = 192\n", 36 | "\n", 37 | "# update_every_sec\n", 38 | "update_every_sec_tier_0 = 1\n", 39 | "update_every_sec_tier_1 = 60\n", 40 | "update_every_sec_tier_2 = 3600\n", 41 | "\n", 42 | "# page_cache_size_mb\n", 43 | "page_cache_size_mb_tier_0 = 64\n", 44 | "page_cache_size_mb_tier_1 = 36\n", 45 | "page_cache_size_mb_tier_2 = 36" 46 | ] 47 | }, 48 | { 49 | "cell_type": "code", 50 | "execution_count": 10, 51 | "metadata": {}, 52 | "outputs": [], 53 | "source": [ 54 | "############################\n", 55 | "# constants\n", 56 | "############################\n", 57 | "\n", 58 | "PER_METRIC_BYTES_64BIT = 165\n", 59 | "PER_PAGE_BYTES_64BIT = 90\n", 60 | "PER_EXTENT_BYTES_64BIT = 32\n", 61 | "PER_FILE_BYTES_64BIT = 88\n", 62 | "CACHE_OVERHEAD_PER_PAGE_BYTES_64BIT = 144\n", 63 | "DISK_OVERHEAD_PERCENTAGE_64BIT = 0.11\n", 64 | "TIER_EVERY_ITERATIONS = 60\n", 65 | "COMPRESSION_DECREASE_PER_TIER = 0.1\n", 66 | "EPHEMERAL_METRICS_PER_DAY = 0.05\n", 67 | "BYTES_PER_METRIC_TIER_0 = 4\n", 68 | "BYTES_PER_METRIC_TIER_1 = 16\n", 69 | "BYTES_PER_METRIC_TIER_2 = 16\n", 70 | "PAGE_SIZE_TIER_0 = 16384\n", 71 | "PAGE_SIZE_TIER_1 = 8192\n", 72 | "PAGE_SIZE_TIER_2 = 4096\n", 73 | "PAGES_PER_EXTENT_TIER_0 = 4\n", 74 | "PAGES_PER_EXTENT_TIER_1 = 8\n", 75 | "PAGES_PER_EXTENT_TIER_2 = 16\n", 76 | "COMPRESSION_SAVINGS_TIER_0 = 0.7\n", 77 | "COMPRESSION_SAVINGS_TIER_1 = 0.7\n", 78 | "COMPRESSION_SAVINGS_TIER_2 = 0.7" 79 | ] 80 | }, 81 | { 82 | "cell_type": "code", 83 | "execution_count": 11, 84 | "metadata": {}, 85 | "outputs": [], 86 | "source": [ 87 | "############################\n", 88 | "# calculations\n", 89 | "############################\n", 90 | "\n", 91 | "observed_average_granularity_secs_tier_0 = update_every_sec_tier_0 * 1.2\n", 92 | "observed_average_granularity_secs_tier_1 = update_every_sec_tier_1 * 1.2\n", 93 | "observed_average_granularity_secs_tier_2 = update_every_sec_tier_2 * 1.2\n", 94 | "\n", 95 | "page_cache_size_in_bytes_tier_0 = page_cache_size_mb_tier_0 * 1024 * 1024\n", 96 | "page_cache_size_in_bytes_tier_1 = page_cache_size_mb_tier_1 * 1024 * 1024\n", 97 | "page_cache_size_in_bytes_tier_2 = page_cache_size_mb_tier_2 * 1024 * 1024\n", 98 | "\n", 99 | "max_full_pages_in_cache_tier_0 = page_cache_size_in_bytes_tier_0 / PAGE_SIZE_TIER_0\n", 100 | "max_full_pages_in_cache_tier_1 = page_cache_size_in_bytes_tier_1 / PAGE_SIZE_TIER_1\n", 101 | "max_full_pages_in_cache_tier_2 = page_cache_size_in_bytes_tier_2 / PAGE_SIZE_TIER_2\n", 102 | "\n", 103 | "cache_overhead_in_bytes_tier_0 = max_full_pages_in_cache_tier_0 * CACHE_OVERHEAD_PER_PAGE_BYTES_64BIT\n", 104 | "cache_overhead_in_bytes_tier_1 = max_full_pages_in_cache_tier_1 * CACHE_OVERHEAD_PER_PAGE_BYTES_64BIT\n", 105 | "cache_overhead_in_bytes_tier_2 = max_full_pages_in_cache_tier_2 * CACHE_OVERHEAD_PER_PAGE_BYTES_64BIT\n", 106 | "\n", 107 | "total_page_cache_bytes_tier_0 = page_cache_size_in_bytes_tier_0 + cache_overhead_in_bytes_tier_0\n", 108 | "total_page_cache_bytes_tier_1 = page_cache_size_in_bytes_tier_1 + cache_overhead_in_bytes_tier_1\n", 109 | "total_page_cache_bytes_tier_2 = page_cache_size_in_bytes_tier_2 + cache_overhead_in_bytes_tier_2\n", 110 | "\n", 111 | "uncompressed_disk_size_tier_0 = (maximum_disk_size_mb_tier_0 * (1 - DISK_OVERHEAD_PERCENTAGE_64BIT) * 1024 * 1024) / (1 - COMPRESSION_SAVINGS_TIER_0)\n", 112 | "uncompressed_disk_size_tier_1 = (maximum_disk_size_mb_tier_1 * (1 - DISK_OVERHEAD_PERCENTAGE_64BIT) * 1024 * 1024) / (1 - COMPRESSION_SAVINGS_TIER_1)\n", 113 | "uncompressed_disk_size_tier_2 = (maximum_disk_size_mb_tier_2 * (1 - DISK_OVERHEAD_PERCENTAGE_64BIT) * 1024 * 1024) / (1 - COMPRESSION_SAVINGS_TIER_2)\n", 114 | "\n", 115 | "pages_tier_0 = uncompressed_disk_size_tier_0 / PAGE_SIZE_TIER_0\n", 116 | "pages_tier_1 = uncompressed_disk_size_tier_1 / PAGE_SIZE_TIER_1\n", 117 | "pages_tier_2 = uncompressed_disk_size_tier_2 / PAGE_SIZE_TIER_2\n", 118 | "\n", 119 | "extents_tier_0 = pages_tier_0 / PAGES_PER_EXTENT_TIER_0\n", 120 | "extents_tier_1 = pages_tier_1 / PAGES_PER_EXTENT_TIER_1\n", 121 | "extents_tier_2 = pages_tier_2 / PAGES_PER_EXTENT_TIER_2\n", 122 | "\n", 123 | "total_points_in_the_database_tier_0 = uncompressed_disk_size_tier_0 / BYTES_PER_METRIC_TIER_0\n", 124 | "total_points_in_the_database_tier_1 = uncompressed_disk_size_tier_1 / BYTES_PER_METRIC_TIER_1\n", 125 | "total_points_in_the_database_tier_2 = uncompressed_disk_size_tier_2 / BYTES_PER_METRIC_TIER_2\n", 126 | "\n", 127 | "points_for_a_full_retention_metric_tier_0 = total_points_in_the_database_tier_0 / average_concurrent_metrics\n", 128 | "points_for_a_full_retention_metric_tier_1 = total_points_in_the_database_tier_1 / average_concurrent_metrics\n", 129 | "points_for_a_full_retention_metric_tier_2 = total_points_in_the_database_tier_2 / average_concurrent_metrics\n", 130 | "\n", 131 | "metric_retention_secs_tier_0 = points_for_a_full_retention_metric_tier_0 * observed_average_granularity_secs_tier_0\n", 132 | "metric_retention_secs_tier_1 = points_for_a_full_retention_metric_tier_1 * observed_average_granularity_secs_tier_1\n", 133 | "metric_retention_secs_tier_2 = points_for_a_full_retention_metric_tier_2 * observed_average_granularity_secs_tier_2\n", 134 | "\n", 135 | "metric_retention_hours_tier_0 = metric_retention_secs_tier_0 / 60 / 60\n", 136 | "metric_retention_hours_tier_1 = metric_retention_secs_tier_1 / 60 / 60\n", 137 | "metric_retention_hours_tier_2 = metric_retention_secs_tier_2 / 60 / 60\n", 138 | "\n", 139 | "metric_retention_days_tier_0 = metric_retention_hours_tier_0 / 24\n", 140 | "metric_retention_days_tier_1 = metric_retention_hours_tier_1 / 24\n", 141 | "metric_retention_days_tier_2 = metric_retention_hours_tier_2 / 24\n", 142 | "\n", 143 | "maximum_number_of_unique_metrics_tier_0 = average_concurrent_metrics + (average_concurrent_metrics * EPHEMERAL_METRICS_PER_DAY * metric_retention_days_tier_0)\n", 144 | "maximum_number_of_unique_metrics_tier_1 = average_concurrent_metrics + (average_concurrent_metrics * EPHEMERAL_METRICS_PER_DAY * metric_retention_days_tier_1)\n", 145 | "maximum_number_of_unique_metrics_tier_2 = average_concurrent_metrics + (average_concurrent_metrics * EPHEMERAL_METRICS_PER_DAY * metric_retention_days_tier_2)\n", 146 | "\n", 147 | "metrics_structures_bytes_tier_0 = (maximum_number_of_unique_metrics_tier_0 * PER_METRIC_BYTES_64BIT) if maximum_disk_size_mb_tier_0 > 0 else 0\n", 148 | "metrics_structures_bytes_tier_1 = (maximum_number_of_unique_metrics_tier_1 * PER_METRIC_BYTES_64BIT) if maximum_disk_size_mb_tier_1 > 0 else 0\n", 149 | "metrics_structures_bytes_tier_2 = (maximum_number_of_unique_metrics_tier_2 * PER_METRIC_BYTES_64BIT) if maximum_disk_size_mb_tier_2 > 0 else 0\n", 150 | "\n", 151 | "pages_structures_bytes_tier_0 = pages_tier_0 * PER_PAGE_BYTES_64BIT\n", 152 | "pages_structures_bytes_tier_1 = pages_tier_1 * PER_PAGE_BYTES_64BIT\n", 153 | "pages_structures_bytes_tier_2 = pages_tier_2 * PER_PAGE_BYTES_64BIT\n", 154 | "\n", 155 | "extents_structures_bytes_tier_0 = extents_tier_0 * PER_EXTENT_BYTES_64BIT\n", 156 | "extents_structures_bytes_tier_1 = extents_tier_1 * PER_EXTENT_BYTES_64BIT\n", 157 | "extents_structures_bytes_tier_2 = extents_tier_2 * PER_EXTENT_BYTES_64BIT\n", 158 | "\n", 159 | "dbengine_index_memory_mb_tier_0 = (metrics_structures_bytes_tier_0 + pages_structures_bytes_tier_0 + extents_structures_bytes_tier_0) / 1024 / 1024\n", 160 | "dbengine_index_memory_mb_tier_1 = (metrics_structures_bytes_tier_1 + pages_structures_bytes_tier_1 + extents_structures_bytes_tier_1) / 1024 / 1024\n", 161 | "dbengine_index_memory_mb_tier_2 = (metrics_structures_bytes_tier_2 + pages_structures_bytes_tier_2 + extents_structures_bytes_tier_2) / 1024 / 1024\n", 162 | "\n", 163 | "collectors_memory_mb_tier_0 = (PAGE_SIZE_TIER_0 * average_concurrent_metrics) / 1024 / 1024\n", 164 | "collectors_memory_mb_tier_1 = (PAGE_SIZE_TIER_1 * average_concurrent_metrics) / 1024 / 1024\n", 165 | "collectors_memory_mb_tier_2 = (PAGE_SIZE_TIER_2 * average_concurrent_metrics) / 1024 / 1024\n", 166 | "\n", 167 | "final_page_cache_size_in_mb_tier_0 = total_page_cache_bytes_tier_0 / 1024 / 1024\n", 168 | "final_page_cache_size_in_mb_tier_1 = total_page_cache_bytes_tier_1 / 1024 / 1024\n", 169 | "final_page_cache_size_in_mb_tier_2 = total_page_cache_bytes_tier_2 / 1024 / 1024\n", 170 | "\n", 171 | "total_ram_memory_mb_tier_0 = dbengine_index_memory_mb_tier_0 + collectors_memory_mb_tier_0 + final_page_cache_size_in_mb_tier_0\n", 172 | "total_ram_memory_mb_tier_1 = dbengine_index_memory_mb_tier_1 + collectors_memory_mb_tier_1 + final_page_cache_size_in_mb_tier_1\n", 173 | "total_ram_memory_mb_tier_2 = dbengine_index_memory_mb_tier_2 + collectors_memory_mb_tier_2 + final_page_cache_size_in_mb_tier_2" 174 | ] 175 | }, 176 | { 177 | "cell_type": "code", 178 | "execution_count": 12, 179 | "metadata": {}, 180 | "outputs": [], 181 | "source": [ 182 | "############################\n", 183 | "# estimated outputs\n", 184 | "############################\n", 185 | "\n", 186 | "estimated_data_points_stored = total_points_in_the_database_tier_0 + total_points_in_the_database_tier_1 + total_points_in_the_database_tier_2\n", 187 | "estimated_points_per_metric = points_for_a_full_retention_metric_tier_0 + points_for_a_full_retention_metric_tier_1 + points_for_a_full_retention_metric_tier_2\n", 188 | "estimated_maximum_days = metric_retention_days_tier_2\n", 189 | "estimated_disk_storage_gb = (maximum_disk_size_mb_tier_0 + maximum_disk_size_mb_tier_1 + maximum_disk_size_mb_tier_2) / 1024\n", 190 | "estimated_ram_mb = total_ram_memory_mb_tier_0 + total_ram_memory_mb_tier_1 + total_ram_memory_mb_tier_2\n", 191 | "estimated_dbengine_tier_1_update_every_iterations = update_every_sec_tier_1 / update_every_sec_tier_0\n", 192 | "estimated_dbengine_tier_2_update_every_iterations = update_every_sec_tier_2 / update_every_sec_tier_1" 193 | ] 194 | }, 195 | { 196 | "cell_type": "code", 197 | "execution_count": 13, 198 | "metadata": {}, 199 | "outputs": [], 200 | "source": [ 201 | "############################\n", 202 | "# outputs\n", 203 | "############################\n", 204 | "\n", 205 | "output_message = f'Netdata will store an estimated **{round(estimated_data_points_stored):000,}** data points (**{round(estimated_points_per_metric):000,} points/metric**) '\n", 206 | "output_message += f'for a maximum of **{round(estimated_maximum_days):000,} days**, utilizing **{round(estimated_disk_storage_gb,2):000,} GB** of disk storage '\n", 207 | "output_message += f'and **{round(estimated_ram_mb):000,} MB** of RAM '\n", 208 | "output_message += f'for a maximum of **{round(metric_retention_days_tier_0):000,} days (T0)**, **{round(metric_retention_days_tier_1):000,} days (T1)**, **{round(metric_retention_days_tier_2):000,} days (T2)**.'\n", 209 | "\n", 210 | "output_netdata_conf = f\"\"\"\n", 211 | "```ini\n", 212 | "# Enter the following in your agent's netdata.conf\n", 213 | "[db]\n", 214 | " mode = dbengine\n", 215 | " storage tiers = 3\n", 216 | " update every = {update_every_sec_tier_0}\n", 217 | " dbengine multihost disk space MB = {maximum_disk_size_mb_tier_0}\n", 218 | " dbengine page cache size MB = {page_cache_size_mb_tier_0}\n", 219 | " dbengine tier 1 update every iterations = {round(estimated_dbengine_tier_1_update_every_iterations)}\n", 220 | " dbengine tier 1 multihost disk space MB = {maximum_disk_size_mb_tier_1}\n", 221 | " dbengine tier 1 page cache size MB = {page_cache_size_mb_tier_1}\n", 222 | " dbengine tier 2 update every iterations = {round(estimated_dbengine_tier_2_update_every_iterations)}\n", 223 | " dbengine tier 2 multihost disk space MB = {maximum_disk_size_mb_tier_2}\n", 224 | " dbengine tier 2 page cache size MB = {page_cache_size_mb_tier_2}\n", 225 | "```\n", 226 | "\"\"\"\n", 227 | "\n", 228 | "final_message = output_message + '\\n' + output_netdata_conf" 229 | ] 230 | }, 231 | { 232 | "cell_type": "code", 233 | "execution_count": 14, 234 | "metadata": {}, 235 | "outputs": [ 236 | { 237 | "data": { 238 | "text/markdown": [ 239 | "Netdata will store an estimated **908,346,436** data points (**363,339 points/metric**) for a maximum of **747 days**, utilizing **1.56 GB** of disk storage and **267 MB** of RAM for a maximum of **4 days (T0)**, **25 days (T1)**, **747 days (T2)**.\n", 240 | "\n", 241 | "```ini\n", 242 | "# Enter the following in your agent's netdata.conf\n", 243 | "[db]\n", 244 | " mode = dbengine\n", 245 | " storage tiers = 3\n", 246 | " update every = 1\n", 247 | " dbengine multihost disk space MB = 1024\n", 248 | " dbengine page cache size MB = 64\n", 249 | " dbengine tier 1 update every iterations = 60\n", 250 | " dbengine tier 1 multihost disk space MB = 384\n", 251 | " dbengine tier 1 page cache size MB = 36\n", 252 | " dbengine tier 2 update every iterations = 60\n", 253 | " dbengine tier 2 multihost disk space MB = 192\n", 254 | " dbengine tier 2 page cache size MB = 36\n", 255 | "```\n" 256 | ], 257 | "text/plain": [ 258 | "" 259 | ] 260 | }, 261 | "execution_count": 14, 262 | "metadata": {}, 263 | "output_type": "execute_result" 264 | } 265 | ], 266 | "source": [ 267 | "# message\n", 268 | "md(final_message)" 269 | ] 270 | } 271 | ], 272 | "metadata": { 273 | "kernelspec": { 274 | "display_name": "Python 3.10.6 64-bit", 275 | "language": "python", 276 | "name": "python3" 277 | }, 278 | "language_info": { 279 | "codemirror_mode": { 280 | "name": "ipython", 281 | "version": 3 282 | }, 283 | "file_extension": ".py", 284 | "mimetype": "text/x-python", 285 | "name": "python", 286 | "nbconvert_exporter": "python", 287 | "pygments_lexer": "ipython3", 288 | "version": "3.10.6" 289 | }, 290 | "orig_nbformat": 4, 291 | "vscode": { 292 | "interpreter": { 293 | "hash": "369f2c481f4da34e4445cda3fffd2e751bd1c4d706f27375911949ba6bb62e1c" 294 | } 295 | } 296 | }, 297 | "nbformat": 4, 298 | "nbformat_minor": 2 299 | } 300 | --------------------------------------------------------------------------------