{"id":3760,"date":"2021-05-21T17:02:55","date_gmt":"2021-05-21T17:02:55","guid":{"rendered":"https:\/\/nenadnoveljic.com\/blog\/?p=3760"},"modified":"2021-05-30T16:18:26","modified_gmt":"2021-05-30T16:18:26","slug":"automating-chia-plotting-on-ubuntu","status":"publish","type":"post","link":"https:\/\/nenadnoveljic.com\/blog\/automating-chia-plotting-on-ubuntu\/","title":{"rendered":"Automating Chia Plotting on Ubuntu"},"content":{"rendered":"\n<p>Chia plotting is both CPU and IO intensive. You can run several plots in parallel until you hit a bottleneck. Plotting in parallel will increase the processing time, but also the throughput. The goal is to maximize the number of plots per day. There&#8217;s a sweet spot after which adding more processes will decrease the throughput. Therefore, it&#8217;s important not to exceed this limit.<\/p>\n\n\n\n<p>The following bash script is a primitive mechanism to maintain the optimal number of plotting processes running. It starts a new processes after a previous completes:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>#!\/usr\/bin\/bash\n\nMAX=$1\n\nif &#91; -z \"$MAX\" ]\nthen\n  echo MAX not set\n  exit 1\nfi\n\nMEMORY=28000\nBASE=\/home\/x\/chia-blockchain\nBIN=$BASE\/venv\/bin\nTEMP1=\/big1\nTEMP2=\/big1\/s1\nDESTINATION='\/media\/x\/My Book Duo\/chia-farms'\nKEY=1111111111\nTHREADS=2\n\ncurrent=`ps -ef | grep chia | grep plots | grep create | wc -l`\n\nif &#91; \"$current\" -ge \"$MAX\" ]; then\n  exit\nfi\n\nmemory_per_plot=$((MEMORY\/MAX))\n\ncd $BASE\n. .\/activate\n\n$BIN\/python $BIN\/chia plots create -k32 -n1 -t$TEMP1 -2$TEMP2 -d\"$DESTINATION\" -b$memory_per_plot -u128 -r$THREADS -a$KEY<\/code><\/pre>\n\n\n\n<p>The command line argument is the maximum number of plot processes.<\/p>\n\n\n\n<p>The script is meant to be scheduled in crontab:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>25,55 * * * * \/home\/x\/chia-blockchain\/create_plot 4 &gt;&gt; \/home\/x\/chia-blockchain\/create_plot.log 2&gt;&amp;1<\/code><\/pre>\n\n\n\n<p>You&#8217;d need to customize the following variables:<\/p>\n\n\n\n<p><\/p>\n\n\n\n<p>MEMORY: total mebibytes allocated for plotting. The script calculates the memory per process to avoid swapping.<br>BASE: Chia software installation directory<br>TEMP1, TEMP2: temporary directories for plotting, optimally on NVMe SSDs. It requires ~300GB per plotting process.<br>DESTINATION: farming directory, usually on cheap storage<br>KEY: wallet key<br>THREADS: the number of threads per plotting process<\/p>\n\n\n\n<p>You can also use this script to find out the optimal degree of parallelism for your system.<\/p>\n\n\n\n<p>After scheduling the script and attaching enough cheap storage for farming you can go away on vacation and hopefully find some coins when you get back \ud83d\ude42<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Chia plotting is both CPU and IO intensive. You can run several plots in parallel until you hit a bottleneck. Plotting in parallel will increase the processing time, but also the throughput. The goal is to maximize the number of&hellip; <a href=\"https:\/\/nenadnoveljic.com\/blog\/automating-chia-plotting-on-ubuntu\/\" class=\"more-link\">Continue Reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"inline_featured_image":false,"footnotes":""},"categories":[41],"tags":[],"class_list":["post-3760","post","type-post","status-publish","format-standard","hentry","category-chia-cryptocurrency"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.4 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Automating Chia Plotting on Ubuntu - All-round Database Topics<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/nenadnoveljic.com\/blog\/automating-chia-plotting-on-ubuntu\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Automating Chia Plotting on Ubuntu - All-round Database Topics\" \/>\n<meta property=\"og:description\" content=\"Chia plotting is both CPU and IO intensive. You can run several plots in parallel until you hit a bottleneck. Plotting in parallel will increase the processing time, but also the throughput. The goal is to maximize the number of&hellip; Continue Reading &rarr;\" \/>\n<meta property=\"og:url\" content=\"https:\/\/nenadnoveljic.com\/blog\/automating-chia-plotting-on-ubuntu\/\" \/>\n<meta property=\"og:site_name\" content=\"All-round Database Topics\" \/>\n<meta property=\"article:published_time\" content=\"2021-05-21T17:02:55+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2021-05-30T16:18:26+00:00\" \/>\n<meta name=\"author\" content=\"Nenad Noveljic\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@NenadNoveljic\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Nenad Noveljic\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"2 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/nenadnoveljic.com\\\/blog\\\/automating-chia-plotting-on-ubuntu\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/nenadnoveljic.com\\\/blog\\\/automating-chia-plotting-on-ubuntu\\\/\"},\"author\":{\"name\":\"Nenad Noveljic\",\"@id\":\"https:\\\/\\\/nenadnoveljic.com\\\/blog\\\/#\\\/schema\\\/person\\\/51458d9dd86dbbdd19f5add451d44efa\"},\"headline\":\"Automating Chia Plotting on Ubuntu\",\"datePublished\":\"2021-05-21T17:02:55+00:00\",\"dateModified\":\"2021-05-30T16:18:26+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/nenadnoveljic.com\\\/blog\\\/automating-chia-plotting-on-ubuntu\\\/\"},\"wordCount\":220,\"commentCount\":3,\"articleSection\":[\"Chia (cryptocurrency)\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/nenadnoveljic.com\\\/blog\\\/automating-chia-plotting-on-ubuntu\\\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/nenadnoveljic.com\\\/blog\\\/automating-chia-plotting-on-ubuntu\\\/\",\"url\":\"https:\\\/\\\/nenadnoveljic.com\\\/blog\\\/automating-chia-plotting-on-ubuntu\\\/\",\"name\":\"Automating Chia Plotting on Ubuntu - All-round Database Topics\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/nenadnoveljic.com\\\/blog\\\/#website\"},\"datePublished\":\"2021-05-21T17:02:55+00:00\",\"dateModified\":\"2021-05-30T16:18:26+00:00\",\"author\":{\"@id\":\"https:\\\/\\\/nenadnoveljic.com\\\/blog\\\/#\\\/schema\\\/person\\\/51458d9dd86dbbdd19f5add451d44efa\"},\"breadcrumb\":{\"@id\":\"https:\\\/\\\/nenadnoveljic.com\\\/blog\\\/automating-chia-plotting-on-ubuntu\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/nenadnoveljic.com\\\/blog\\\/automating-chia-plotting-on-ubuntu\\\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/nenadnoveljic.com\\\/blog\\\/automating-chia-plotting-on-ubuntu\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/nenadnoveljic.com\\\/blog\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Automating Chia Plotting on Ubuntu\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/nenadnoveljic.com\\\/blog\\\/#website\",\"url\":\"https:\\\/\\\/nenadnoveljic.com\\\/blog\\\/\",\"name\":\"All-round Database Topics\",\"description\":\"Nenad Noveljic\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/nenadnoveljic.com\\\/blog\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/nenadnoveljic.com\\\/blog\\\/#\\\/schema\\\/person\\\/51458d9dd86dbbdd19f5add451d44efa\",\"name\":\"Nenad Noveljic\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/a97b796613ea48ec8a7b79c8ffe1c685dcffc920c68121f6238d5caab5070670?s=96&d=mm&r=g\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/a97b796613ea48ec8a7b79c8ffe1c685dcffc920c68121f6238d5caab5070670?s=96&d=mm&r=g\",\"contentUrl\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/a97b796613ea48ec8a7b79c8ffe1c685dcffc920c68121f6238d5caab5070670?s=96&d=mm&r=g\",\"caption\":\"Nenad Noveljic\"},\"sameAs\":[\"nenad-noveljic-9b746a6\",\"https:\\\/\\\/x.com\\\/NenadNoveljic\"],\"url\":\"https:\\\/\\\/nenadnoveljic.com\\\/blog\\\/author\\\/nenad\\\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Automating Chia Plotting on Ubuntu - All-round Database Topics","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/nenadnoveljic.com\/blog\/automating-chia-plotting-on-ubuntu\/","og_locale":"en_US","og_type":"article","og_title":"Automating Chia Plotting on Ubuntu - All-round Database Topics","og_description":"Chia plotting is both CPU and IO intensive. You can run several plots in parallel until you hit a bottleneck. Plotting in parallel will increase the processing time, but also the throughput. The goal is to maximize the number of&hellip; Continue Reading &rarr;","og_url":"https:\/\/nenadnoveljic.com\/blog\/automating-chia-plotting-on-ubuntu\/","og_site_name":"All-round Database Topics","article_published_time":"2021-05-21T17:02:55+00:00","article_modified_time":"2021-05-30T16:18:26+00:00","author":"Nenad Noveljic","twitter_card":"summary_large_image","twitter_creator":"@NenadNoveljic","twitter_misc":{"Written by":"Nenad Noveljic","Est. reading time":"2 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/nenadnoveljic.com\/blog\/automating-chia-plotting-on-ubuntu\/#article","isPartOf":{"@id":"https:\/\/nenadnoveljic.com\/blog\/automating-chia-plotting-on-ubuntu\/"},"author":{"name":"Nenad Noveljic","@id":"https:\/\/nenadnoveljic.com\/blog\/#\/schema\/person\/51458d9dd86dbbdd19f5add451d44efa"},"headline":"Automating Chia Plotting on Ubuntu","datePublished":"2021-05-21T17:02:55+00:00","dateModified":"2021-05-30T16:18:26+00:00","mainEntityOfPage":{"@id":"https:\/\/nenadnoveljic.com\/blog\/automating-chia-plotting-on-ubuntu\/"},"wordCount":220,"commentCount":3,"articleSection":["Chia (cryptocurrency)"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/nenadnoveljic.com\/blog\/automating-chia-plotting-on-ubuntu\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/nenadnoveljic.com\/blog\/automating-chia-plotting-on-ubuntu\/","url":"https:\/\/nenadnoveljic.com\/blog\/automating-chia-plotting-on-ubuntu\/","name":"Automating Chia Plotting on Ubuntu - All-round Database Topics","isPartOf":{"@id":"https:\/\/nenadnoveljic.com\/blog\/#website"},"datePublished":"2021-05-21T17:02:55+00:00","dateModified":"2021-05-30T16:18:26+00:00","author":{"@id":"https:\/\/nenadnoveljic.com\/blog\/#\/schema\/person\/51458d9dd86dbbdd19f5add451d44efa"},"breadcrumb":{"@id":"https:\/\/nenadnoveljic.com\/blog\/automating-chia-plotting-on-ubuntu\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/nenadnoveljic.com\/blog\/automating-chia-plotting-on-ubuntu\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/nenadnoveljic.com\/blog\/automating-chia-plotting-on-ubuntu\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/nenadnoveljic.com\/blog\/"},{"@type":"ListItem","position":2,"name":"Automating Chia Plotting on Ubuntu"}]},{"@type":"WebSite","@id":"https:\/\/nenadnoveljic.com\/blog\/#website","url":"https:\/\/nenadnoveljic.com\/blog\/","name":"All-round Database Topics","description":"Nenad Noveljic","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/nenadnoveljic.com\/blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Person","@id":"https:\/\/nenadnoveljic.com\/blog\/#\/schema\/person\/51458d9dd86dbbdd19f5add451d44efa","name":"Nenad Noveljic","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/secure.gravatar.com\/avatar\/a97b796613ea48ec8a7b79c8ffe1c685dcffc920c68121f6238d5caab5070670?s=96&d=mm&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/a97b796613ea48ec8a7b79c8ffe1c685dcffc920c68121f6238d5caab5070670?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/a97b796613ea48ec8a7b79c8ffe1c685dcffc920c68121f6238d5caab5070670?s=96&d=mm&r=g","caption":"Nenad Noveljic"},"sameAs":["nenad-noveljic-9b746a6","https:\/\/x.com\/NenadNoveljic"],"url":"https:\/\/nenadnoveljic.com\/blog\/author\/nenad\/"}]}},"_links":{"self":[{"href":"https:\/\/nenadnoveljic.com\/blog\/wp-json\/wp\/v2\/posts\/3760","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/nenadnoveljic.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/nenadnoveljic.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/nenadnoveljic.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/nenadnoveljic.com\/blog\/wp-json\/wp\/v2\/comments?post=3760"}],"version-history":[{"count":1,"href":"https:\/\/nenadnoveljic.com\/blog\/wp-json\/wp\/v2\/posts\/3760\/revisions"}],"predecessor-version":[{"id":3765,"href":"https:\/\/nenadnoveljic.com\/blog\/wp-json\/wp\/v2\/posts\/3760\/revisions\/3765"}],"wp:attachment":[{"href":"https:\/\/nenadnoveljic.com\/blog\/wp-json\/wp\/v2\/media?parent=3760"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/nenadnoveljic.com\/blog\/wp-json\/wp\/v2\/categories?post=3760"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/nenadnoveljic.com\/blog\/wp-json\/wp\/v2\/tags?post=3760"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}