{"id":21827,"date":"2024-07-18T16:47:43","date_gmt":"2024-07-18T23:47:43","guid":{"rendered":"https:\/\/tdengine.com\/?p=21827"},"modified":"2025-03-30T23:05:34","modified_gmt":"2025-03-31T06:05:34","slug":"testing-vertical-scalability","status":"publish","type":"post","link":"https:\/\/tdengine.com\/testing-vertical-scalability\/","title":{"rendered":"Testing TDengine\u2019s Vertical Scalability"},"content":{"rendered":"\n<p>Scaling vertically (or scaling up) refers to increasing hardware resources on an existing server. Ensuring that database management systems are vertically scalable and can make use of these new resources is not an easy task, requiring a well-designed framework with minimal resource consumption internally. Considering the large datasets typically processed by a <a href=\"https:\/\/tdengine.com\/what-is-a-time-series-database\/\">time-series database<\/a>, scaling up and scaling out are both essential capabilities.<\/p>\n\n\n\n<p>To test whether TDengine is vertically scalable, we can construct an environment in which a specific hardware resource is the performance bottleneck of the system, and then gradually add resources to the system to see how performance is affected. In this article, the vertical scalability of TDengine will be tested in terms of CPU and disk resources.<\/p>\n\n\n\n<h2 class=\"gb-headline gb-headline-421dd220 gb-headline-text\">Scaling Up CPU Cores<\/h2>\n\n\n\n<p>This test is intended to prove that, in a scenario where memory and disk resources cannot become bottlenecks, there is a direct relationship between the number of cores available to TDengine and the write speed of TDengine.<\/p>\n\n\n\n<h3 class=\"gb-headline gb-headline-19743bae gb-headline-text\">Methodology<\/h3>\n\n\n\n<p>In this test, TDengine 3.3.0.0 was deployed from the official Docker image on <a href=\"https:\/\/hub.docker.com\/r\/tdengine\/tdengine\" rel=\"noopener\">Docker Hub<\/a>. A fixed number of cores were bound to the Docker container. The <a href=\"https:\/\/tdengine.com\/test-tdengine-with-taosbenchmark\/\">taosBenchmark<\/a> tool was used to write data to TDengine using the smart meters schema described in the <a href=\"https:\/\/docs.tdengine.com\/basic-features\/data-model\/\">official documentation<\/a>. The number of vgroups and write threads were both set to 4 initially, but when testing 5 or more cores, these parameters were increased to 12. This ensures that CPU resources remain the performance bottleneck.<\/p>\n\n\n\n<p>The test data is described as follows:<\/p>\n\n\n\n<ul class=\"wp-block-list nopad-li\">\n<li>Databases: 1<\/li>\n\n\n\n<li>Supertables: 1<\/li>\n\n\n\n<li>Subtables: 100<\/li>\n\n\n\n<li>Rows per subtable: 1 million<\/li>\n\n\n\n<li>Total records: 100 million<\/li>\n<\/ul>\n\n\n\n<h3 class=\"gb-headline gb-headline-ae7636e9 gb-headline-text\">Results<\/h3>\n\n\n\n<figure class=\"gb-block-image gb-block-image-d8e22fec\"><img decoding=\"async\" width=\"960\" height=\"540\" class=\"gb-image gb-image-d8e22fec\" src=\"https:\/\/eujqw4hwudm.exactdn.com\/wp-content\/uploads\/Slide1-1.png?strip=all&sharp=1\" alt=\"\" title=\"Slide1\" srcset=\"https:\/\/eujqw4hwudm.exactdn.com\/wp-content\/uploads\/Slide1-1.png?strip=all&amp;sharp=1 960w, https:\/\/eujqw4hwudm.exactdn.com\/wp-content\/uploads\/Slide1-1-300x169.png?strip=all&amp;sharp=1 300w, https:\/\/eujqw4hwudm.exactdn.com\/wp-content\/uploads\/Slide1-1-768x432.png?strip=all&amp;sharp=1 768w, https:\/\/eujqw4hwudm.exactdn.com\/wp-content\/uploads\/Slide1-1.png?strip=all&amp;sharp=1&amp;w=192 192w, https:\/\/eujqw4hwudm.exactdn.com\/wp-content\/uploads\/Slide1-1.png?strip=all&amp;sharp=1&amp;w=384 384w, https:\/\/eujqw4hwudm.exactdn.com\/wp-content\/uploads\/Slide1-1.png?strip=all&amp;sharp=1&amp;w=576 576w, https:\/\/eujqw4hwudm.exactdn.com\/wp-content\/uploads\/Slide1-1.png?strip=all&amp;sharp=1&amp;w=450 450w\" sizes=\"(max-width: 960px) 100vw, 960px\" \/><\/figure>\n\n\n\n<table id=\"tablepress-57\" class=\"tablepress tablepress-id-57\">\n<thead>\n<tr class=\"row-1\">\n\t<th class=\"column-1\">CPU Cores<\/th><th class=\"column-2\">Vgroups<\/th><th class=\"column-3\">Write Threads<\/th><th class=\"column-4\">Write Speed<br \/>\n(Rows per Second)<\/th><th class=\"column-5\">Disk I\/O<br \/>\n(MBps)<\/th><th class=\"column-6\">Available Memory<br \/>\n(GB)<\/th><th class=\"column-7\">CPU Usage<\/th>\n<\/tr>\n<\/thead>\n<tbody class=\"row-striping row-hover\">\n<tr class=\"row-2\">\n\t<td class=\"column-1\">1<\/td><td class=\"column-2\">4<\/td><td class=\"column-3\">4<\/td><td class=\"column-4\">380,000<\/td><td class=\"column-5\">13<\/td><td class=\"column-6\">200<\/td><td class=\"column-7\">96%<\/td>\n<\/tr>\n<tr class=\"row-3\">\n\t<td class=\"column-1\">2<\/td><td class=\"column-2\">4<\/td><td class=\"column-3\">4<\/td><td class=\"column-4\">880,000<\/td><td class=\"column-5\">36<\/td><td class=\"column-6\">200<\/td><td class=\"column-7\">95%<\/td>\n<\/tr>\n<tr class=\"row-4\">\n\t<td class=\"column-1\">3<\/td><td class=\"column-2\">4<\/td><td class=\"column-3\">4<\/td><td class=\"column-4\">1,480,000<\/td><td class=\"column-5\">45<\/td><td class=\"column-6\">198<\/td><td class=\"column-7\">95%<\/td>\n<\/tr>\n<tr class=\"row-5\">\n\t<td class=\"column-1\">4<\/td><td class=\"column-2\">4<\/td><td class=\"column-3\">4<\/td><td class=\"column-4\">1,930,000<\/td><td class=\"column-5\">60<\/td><td class=\"column-6\">193<\/td><td class=\"column-7\">88%<\/td>\n<\/tr>\n<tr class=\"row-6\">\n\t<td class=\"column-1\">5<\/td><td class=\"column-2\">12<\/td><td class=\"column-3\">12<\/td><td class=\"column-4\">2,450,000<\/td><td class=\"column-5\">73<\/td><td class=\"column-6\">104<\/td><td class=\"column-7\">96%<\/td>\n<\/tr>\n<tr class=\"row-7\">\n\t<td class=\"column-1\">6<\/td><td class=\"column-2\">12<\/td><td class=\"column-3\">12<\/td><td class=\"column-4\">2,880,000<\/td><td class=\"column-5\">85<\/td><td class=\"column-6\">104<\/td><td class=\"column-7\">94%<\/td>\n<\/tr>\n<tr class=\"row-8\">\n\t<td class=\"column-1\">12<\/td><td class=\"column-2\">12<\/td><td class=\"column-3\">12<\/td><td class=\"column-4\">5,730,000<\/td><td class=\"column-5\">167<\/td><td class=\"column-6\">102<\/td><td class=\"column-7\">90%<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<!-- #tablepress-57 from cache -->\n\n\n<p>The disk drive in the test scenario was a solid-state disk (SSD) with a maximum throughput of 350 MBps, meaning that I\/O resources were sufficient throughout the test. The server and client in the test scenario were run on the same machine, meaning that network bandwidth could not become a bottleneck.<\/p>\n\n\n\n<p>Each time a core was added, write performance increased by approximately 500,000 rows per second. Disk I\/O increased at approximately the same rate as write speed. From this it can be concluded that TDengine is vertically scalable in terms of CPU cores.<\/p>\n\n\n\n<h2 class=\"gb-headline gb-headline-2ca60dad gb-headline-text\">Scaling Up Disk Drives<\/h2>\n\n\n\n<p>This test is intended to prove that, in a scenario where CPU and memory resources cannot become bottlenecks, there is a direct relationship between the number of disks available to TDengine and the write speed of TDengine.<\/p>\n\n\n\n<h3 class=\"gb-headline gb-headline-bf525268 gb-headline-text\">Methodology<\/h3>\n\n\n\n<p>In this test, TDengine 3.3.0.0 was deployed on Ubuntu 20.4 with 24 cores and 64 GB of RAM. 5400 RPM HDDs were mounted to this system in the same tier &#8212; relatively slow disks to ensure that disk I\/O remained the bottleneck during this test. The taosBenchmark tool was used to write data to TDengine using the following schema:<\/p>\n\n\n\n<table id=\"tablepress-58\" class=\"tablepress tablepress-id-58\">\n<thead>\n<tr class=\"row-1\">\n\t<th class=\"column-1\">Columns<\/th><th class=\"column-2\">Data Type<\/th><th class=\"column-3\">Length<\/th>\n<\/tr>\n<\/thead>\n<tbody class=\"row-striping row-hover\">\n<tr class=\"row-2\">\n\t<td class=\"column-1\">1<\/td><td class=\"column-2\">TIMESTAMP<\/td><td class=\"column-3\">8<\/td>\n<\/tr>\n<tr class=\"row-3\">\n\t<td class=\"column-1\">1<\/td><td class=\"column-2\">DOUBLE<\/td><td class=\"column-3\">8<\/td>\n<\/tr>\n<tr class=\"row-4\">\n\t<td class=\"column-1\">1<\/td><td class=\"column-2\">BIGINT<\/td><td class=\"column-3\">8<\/td>\n<\/tr>\n<tr class=\"row-5\">\n\t<td class=\"column-1\">5<\/td><td class=\"column-2\">BINARY<\/td><td class=\"column-3\">5000<\/td>\n<\/tr>\n<tr class=\"row-6\">\n\t<td class=\"column-1\">3<\/td><td class=\"column-2\">NCHAR<\/td><td class=\"column-3\">2500<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<!-- #tablepress-58 from cache -->\n\n\n<p>In this schema, each row of data occupies 32,524 bytes. These relatively large rows consume I\/O resources faster.<\/p>\n\n\n\n<p>The test data is described as follows:<\/p>\n\n\n\n<ul class=\"wp-block-list nopad-li\">\n<li>Databases: 1<\/li>\n\n\n\n<li>Vgroups: 16<\/li>\n\n\n\n<li>Supertables: 1<\/li>\n\n\n\n<li>Subtables: 100<\/li>\n\n\n\n<li>Rows per subtable: 10,000<\/li>\n\n\n\n<li>Total records: 1 million<\/li>\n<\/ul>\n\n\n\n<p>taosBenchmark was additionally configured as follows:<\/p>\n\n\n\n<ul class=\"wp-block-list nopad-li\">\n<li>Write threads: 16<\/li>\n\n\n\n<li>Write method: parameter binding mode<\/li>\n<\/ul>\n\n\n\n<h3 class=\"gb-headline gb-headline-4fd2071d gb-headline-text\">Results<\/h3>\n\n\n\n<figure class=\"gb-block-image gb-block-image-2eb6c57e\"><img decoding=\"async\" width=\"960\" height=\"540\" class=\"gb-image gb-image-2eb6c57e\" src=\"https:\/\/eujqw4hwudm.exactdn.com\/wp-content\/uploads\/Slide2.png?strip=all&sharp=1\" alt=\"\" title=\"Slide2\" srcset=\"https:\/\/eujqw4hwudm.exactdn.com\/wp-content\/uploads\/Slide2.png?strip=all&amp;sharp=1 960w, https:\/\/eujqw4hwudm.exactdn.com\/wp-content\/uploads\/Slide2-300x169.png?strip=all&amp;sharp=1 300w, https:\/\/eujqw4hwudm.exactdn.com\/wp-content\/uploads\/Slide2-768x432.png?strip=all&amp;sharp=1 768w, https:\/\/eujqw4hwudm.exactdn.com\/wp-content\/uploads\/Slide2.png?strip=all&amp;sharp=1&amp;w=192 192w, https:\/\/eujqw4hwudm.exactdn.com\/wp-content\/uploads\/Slide2.png?strip=all&amp;sharp=1&amp;w=384 384w, https:\/\/eujqw4hwudm.exactdn.com\/wp-content\/uploads\/Slide2.png?strip=all&amp;sharp=1&amp;w=576 576w, https:\/\/eujqw4hwudm.exactdn.com\/wp-content\/uploads\/Slide2.png?strip=all&amp;sharp=1&amp;w=450 450w\" sizes=\"(max-width: 960px) 100vw, 960px\" \/><\/figure>\n\n\n\n<table id=\"tablepress-60\" class=\"tablepress tablepress-id-60\">\n<thead>\n<tr class=\"row-1\">\n\t<th class=\"column-1\">Disks<\/th><th class=\"column-2\">Committed Threads<\/th><th class=\"column-3\">Write Speed<br \/>\n(Rows per Second)<\/th><th class=\"column-4\">CPU Usage<\/th><th class=\"column-5\">Disk I\/O<br \/>\n(MBps)<\/th>\n<\/tr>\n<\/thead>\n<tbody class=\"row-striping row-hover\">\n<tr class=\"row-2\">\n\t<td class=\"column-1\">1<\/td><td class=\"column-2\">4<\/td><td class=\"column-3\">1024<\/td><td class=\"column-4\">5%<\/td><td class=\"column-5\">80&#8211;90<\/td>\n<\/tr>\n<tr class=\"row-3\">\n\t<td class=\"column-1\">2<\/td><td class=\"column-2\">4<\/td><td class=\"column-3\">1929<\/td><td class=\"column-4\">11%<\/td><td class=\"column-5\">150&#8211;190<\/td>\n<\/tr>\n<tr class=\"row-4\">\n\t<td class=\"column-1\">3<\/td><td class=\"column-2\">8<\/td><td class=\"column-3\">4098<\/td><td class=\"column-4\">19%<\/td><td class=\"column-5\">380&#8211;450<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<!-- #tablepress-60 from cache -->\n\n\n<p>The 24-core CPU used in the test environment was mostly idle throughout the tests, meaning that compute resources were sufficient. The server and client in the test scenario were run on the same machine, meaning that network bandwidth could not become a bottleneck.<\/p>\n\n\n\n<p>It was necessary to increase the number of committed threads once three disks are mounted to ensure that I\/O performance remains the bottleneck. Committed threads are the threads used to write data to disk.<\/p>\n\n\n\n<p>Each time a disk was mounted, write performance increased linearly and the new disk was used fully. From this it can be concluded that TDengine is vertically scalable in terms of disk drives.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>In this article, the vertical scalability of TDengine will be tested in terms of CPU and disk resources.<\/p>\n","protected":false},"author":81,"featured_media":21851,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"content-type":"","footnotes":""},"categories":[21],"tags":[],"ppma_author":[167],"class_list":["post-21827","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-engineering"],"authors":[{"term_id":167,"user_id":81,"is_guest":0,"slug":"chait","display_name":"Chait Diwadkar","avatar_url":{"url":"https:\/\/tdengine.com\/wp-content\/uploads\/29.03-05-cdiwadkar.jpg","url2x":"https:\/\/tdengine.com\/wp-content\/uploads\/29.03-05-cdiwadkar.jpg"},"1":"","2":"","3":"","4":"","5":"","6":"","7":"","8":""}],"_links":{"self":[{"href":"https:\/\/tdengine.com\/wp-json\/wp\/v2\/posts\/21827","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/tdengine.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/tdengine.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/tdengine.com\/wp-json\/wp\/v2\/users\/81"}],"replies":[{"embeddable":true,"href":"https:\/\/tdengine.com\/wp-json\/wp\/v2\/comments?post=21827"}],"version-history":[{"count":11,"href":"https:\/\/tdengine.com\/wp-json\/wp\/v2\/posts\/21827\/revisions"}],"predecessor-version":[{"id":24734,"href":"https:\/\/tdengine.com\/wp-json\/wp\/v2\/posts\/21827\/revisions\/24734"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/tdengine.com\/wp-json\/wp\/v2\/media\/21851"}],"wp:attachment":[{"href":"https:\/\/tdengine.com\/wp-json\/wp\/v2\/media?parent=21827"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/tdengine.com\/wp-json\/wp\/v2\/categories?post=21827"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/tdengine.com\/wp-json\/wp\/v2\/tags?post=21827"},{"taxonomy":"author","embeddable":true,"href":"https:\/\/tdengine.com\/wp-json\/wp\/v2\/ppma_author?post=21827"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}