<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Ayush Bilala on Medium]]></title>
        <description><![CDATA[Stories by Ayush Bilala on Medium]]></description>
        <link>https://medium.com/@ayushbilala?source=rss-77446748f093------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/2*FPJNQDDmguK8JWwUhUFRFQ.png</url>
            <title>Stories by Ayush Bilala on Medium</title>
            <link>https://medium.com/@ayushbilala?source=rss-77446748f093------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sat, 05 Dec 2026 08:23:11 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@ayushbilala/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Significance of ORC File Stripe Size in Trino Queries]]></title>
            <link>https://medium.com/walmartglobaltech/significance-of-orc-file-stripe-size-in-trino-queries-82cae4aed557?source=rss-77446748f093------2</link>
            <guid isPermaLink="false">https://medium.com/p/82cae4aed557</guid>
            <category><![CDATA[presto]]></category>
            <category><![CDATA[engineering]]></category>
            <category><![CDATA[trinos]]></category>
            <category><![CDATA[orcs]]></category>
            <category><![CDATA[big-data]]></category>
            <dc:creator><![CDATA[Ayush Bilala]]></dc:creator>
            <pubDate>Thu, 05 Oct 2023 09:21:03 GMT</pubDate>
            <atom:updated>2023-10-05T09:21:03.842Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/700/1*5RuTwUnPZduLI2MtaLTZgQ.png" /></figure><h3>Introduction</h3><p>ORC file stripe size is a critical factor in optimizing Trino query performance. This blog explores how ORC files, as columnar storage formats, influence data processing efficiency and why stripe size matters. It also presents insights gained from controlled experiments on the impact of different stripe sizes on Trino queries.</p><p>By understanding the significance of ORC file stripe size, readers will gain actionable knowledge to enhance their Trino-based big data analytics.</p><h3>ORC files and their significance in big data processing</h3><p><strong>ORC (Optimized Row Columnar)</strong> files are columnar storage files that offer several benefits over row-based formats. They are compressed, support predicate pushdown, can handle skewed data, are compatible with Hive and Trino, and support complex data types.<br>Here is a table that summarizes the key features and benefits of ORC files:</p><ol><li><strong>Columnar Storage</strong>: ORC files organize data in a columnar format rather than row-based, which enhances compression and processing efficiency for specific columns during queries.</li><li><strong>Compression</strong>: Using diverse compression techniques, ORC files reduce storage space and improve query performance. The columnar layout leads to efficient compression due to the grouping of similar data values.</li><li><strong>Predicate Pushdown</strong>: ORC files support predicate pushdown, filtering data before reading from disk during queries. This leverages the columnar storage to minimize disk reads, leading to faster query processing.</li><li><strong>Data Skew Handling</strong>: ORC files effectively manage skewed data. For heavily skewed data values, ORC can isolate and store them separately, enhancing query performance in such cases.</li><li><strong>Hive and Trino Compatibility</strong>: ORC files are natively supported by Apache Hive and Trino, allowing seamless integration into big data ecosystems. Users can utilize existing tools and infrastructure effectively.</li><li><strong>Complex Data Types</strong>: ORC files accommodate complex data types like structs, lists, maps, and unions, enabling storage and processing of nested and hierarchical data in an organized manner.</li></ol><h3>Trino as a distributed SQL query engine</h3><p><strong>Trino</strong> is a powerful distributed SQL query engine in big data analytics. Known for high performance and scalability, it is favoured for its distributed architecture and versatile capabilities.</p><ol><li><strong>High Performance</strong>: Trino executes queries with exceptional speed by leveraging <strong>distributed processing</strong> across nodes, managing large data and complex queries efficiently.</li><li><strong>Scalability</strong>: With <strong>horizontal scaling</strong>, Trino grows by adding worker nodes, managing increasing data volumes and query demands.</li><li><strong>Compatibility</strong>: Trino adheres to <strong>ANSI SQL</strong> standards, integrating seamlessly with various SQL-based tools and systems.</li><li><strong>Data Source Agnostic</strong>: Trino works with diverse storage systems, be it relational databases, data lakes, or cloud storage, consolidating data sources for holistic analysis.</li><li><strong>Federated Queries</strong>: Trino supports <strong>querying multiple sources as a single database</strong>, simplifying data analysis by seamlessly combining data.</li><li><strong>Interactive Analysis</strong>: Trino offers <strong>real-time data exploration</strong> <strong>and analysis</strong> with low-latency performance, perfect for ad-hoc and iterative analysis.</li></ol><h3>ORC Stripes</h3><p><strong>ORC file stripe size</strong> is a key parameter for improving big data analytics performance. Stripes are chunks of data that are stored in ORC files. Each stripe is an independent section of the file that contains a specific amount of data.</p><p>The stripe size is a critical parameter for ORC file performance. It determines the size of each individual stripe in the file, which can vary depending on the data access patterns and data characteristics. Stripe sizes are typically set in bytes and can range from a few kilobytes to several megabytes.</p><figure><img alt="ORC File Structure" src="https://cdn-images-1.medium.com/max/532/1*hQxJt4bUASbhLew8sfhYvw.png" /><figcaption>ORC File Structure</figcaption></figure><h3>Small ORC Stripes = Poor Performance in Trino</h3><p>While smaller stripe sizes in ORC files can offer benefits such as better compression, improved predicate pushdown, and more efficient memory utilization, they can also lead to suboptimal performance in Trino queries due to several reasons:</p><ol><li><strong>Metadata Overhead</strong>: Smaller stripe sizes mean more stripes in the ORC file, which increases the amount of metadata associated with each stripe that Trino needs to read and process this metadata. This can lead to slower query execution.</li><li><strong>Increased Disk I/O</strong>: Trino reads data in chunks (stripes) from disk during query execution. With smaller stripe sizes, more disk I/O operations are required to read the same amount of data. This can result in increased latency and slower query performance, especially when dealing with a high volume of data.</li><li><strong>Network Overhead</strong>: Trino distributes data across worker nodes in a cluster for parallel processing. Smaller stripe sizes can lead to more frequent data transfers between nodes, causing higher network overhead.</li><li><strong>Reduced Compression Efficiency</strong>: While smaller stripe sizes can improve compression efficiency for individual stripes, they can also lead to less efficient overall compression for the entire ORC file. This can lead to larger file sizes and increased storage requirements.</li><li><strong>Suboptimal Predicate Pushdown</strong>: Predicate pushdown is a technique that can help to improve query performance by allowing Trino to filter data before it is read from disk. Smaller stripe sizes can theoretically allow for more efficient predicate pushdown, but in practice, the overhead of managing and processing many smaller stripes can outweigh the benefits. This can result in less effective predicate pushdown and reduced query performance.</li></ol><p>Smaller stripe sizes can be beneficial in some cases, but they can also lead to inefficiencies in Trino queries. Striking the right balance between stripe size and other performance considerations is essential to achieve optimal query performance in Trino. The optimal stripe size will vary depending on the specific workload and data characteristics.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*EzEivb-UeWfrsA2c8IGz3w.png" /><figcaption>Data read request count to underlying storage decreases with the increase in ORC stripe size.</figcaption></figure><p>We performed an experiment with ORC files of 900 MB, varying stripe sizes from 8 MB to 256 MB. The chart above shows that Trino made fewer data read requests to the storage underneath for data retrieval. It is evident that as the stripe size increases, the number of data read requests from Trino to the storage decreases.</p><h3>Trino Configuration for Handling Stripes</h3><p>Trino configuration property “<strong>hive.orc.tiny-stripe-threshold</strong>” determines the threshold size below which ORC files will be considered as “tiny stripes.” This property affects the stripe/file size threshold when ORC reader decides to read multiple consecutive stripes or entire files at once<br><br>The property has three main effects:</p><ol><li><strong>Storage Efficiency</strong>: Each stripe in an ORC file has associated metadata. For tiny stripes, this metadata overhead can become proportionally larger, potentially leading to inefficiencies. By treating tiny stripes differently, ORC aims to reduce this metadata overhead and optimize storage.</li><li><strong>Query Performance</strong>: Tiny stripes can be less efficient for query processing due to the increased metadata overhead. By setting a threshold with “hive.orc.tiny-stripe-threshold,” you can ensure that very small stripes are treated in a way that balances storage efficiency with query performance.</li><li><strong>Configuration</strong>: The value you set for “hive.orc.tiny-stripe-threshold” specifies the size (in bytes) below which a stripe will be considered as “tiny.” This value should be chosen carefully, considering factors such as the typical size of your data, the hardware configuration, and the query workload.</li></ol><h3>Considerations for Choosing Stripe Size</h3><p>Choosing the right stripe size for ORC files involves considering various factors that can impact query performance, storage efficiency, and overall system resources. Here are some key considerations to keep in mind when choosing stripe sizes:</p><ol><li><strong>Data Volume</strong>: Consider the volume of data being processed. Smaller stripe sizes may be suitable for smaller datasets or when dealing with real-time, small queries. For larger datasets, larger stripe sizes might be more efficient to minimize metadata overhead and reduce the number of stripes.</li><li><strong>Query Complexity</strong>: Analyze the complexity of the queries being executed. Smaller stripe sizes may benefit queries with predicate filters or selective column access due to improved predicate pushdown and better memory utilization. On the other hand, larger stripe sizes might be more efficient for queries involving large-scale scans or aggregations.</li><li><strong>Data Distribution</strong>: Examine the data distribution patterns in the dataset. If the data is evenly distributed, both small and large stripe sizes might perform well. However, for skewed data distributions, smaller stripes can handle data skew more efficiently by storing skewed data separately.</li><li><strong>Query Throughput</strong>: Consider the query throughput requirements. Smaller stripe sizes might be beneficial for handling a higher number of concurrent small queries effectively. Larger stripe sizes can optimize query throughput for larger queries with reduced metadata and I/O overhead.</li><li><strong>Disk Utilization</strong>: Assess the disk utilization requirements and constraints. Smaller stripe sizes can optimize disk space usage by enabling better compression for individual stripes. Larger stripe sizes can minimize disk fragmentation and reduce overhead for metadata storage.</li><li><strong>Workload Variation</strong>: Consider the variation in the types of queries and workloads. If the workload involves a mix of small and large queries, a compromise on stripe size might be necessary to balance performance across different query types.</li><li><strong>System Configuration</strong>: Consider the configuration of the data processing system, including the <strong>number of nodes</strong>, <strong>CPU</strong>, <strong>memory</strong>, and <strong>network capabilities</strong>. Smaller stripe sizes might improve parallel processing and distribution efficiency in a large cluster, while larger stripe sizes may reduce metadata overhead and network traffic.</li><li><strong>Cost vs Performance Trade-off</strong>: In scenarios where queries encompass substantial data volumes, opting for a smaller stripe size might potentially affect query performance. This is due to the higher number of metadata entries, leading to increased overhead during query execution. Consequently, this could amplify the count of list and get requests made to the underlying storage, subsequently inflating access costs.<br>On the contrary, larger stripe sizes translate to fewer requests to the underlying storage, culminating in lower access costs. To manage the amount of data read in each request, Trino leverages the <strong>max-split-size</strong> configuration property. This property controls the largest size of an individual file section allocated to a worker.</li></ol><p>By carefully analyzing these considerations and testing different stripe sizes on representative datasets and queries, data engineers can identify optimal stripe size which meets the specific performance and storage requirements of their data processing environment. It is often an iterative process of experimentation and tuning to find the right balance for the given workload and data characteristics.</p><h3>Conclusion</h3><p>ORC file stripe size is a critical factor in achieving optimal query performance in Trino queries. It directly affects compression, data access efficiency, memory usage, and data skew handling.</p><p>Finding the right balance in stripe size selection is vital for maximizing Trino’s capabilities and ensuring efficient data processing in large-scale big data analytics environments. By considering multiple factors and continuously fine-tuning stripe sizes, organizations can unlock the full potential of Trino for fast, efficient, and reliable data analytics and exploration.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=82cae4aed557" width="1" height="1" alt=""><hr><p><a href="https://medium.com/walmartglobaltech/significance-of-orc-file-stripe-size-in-trino-queries-82cae4aed557">Significance of ORC File Stripe Size in Trino Queries</a> was originally published in <a href="https://medium.com/walmartglobaltech">Walmart Global Tech Blog</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Custom Downscaler For Trino Cluster on Google Cloud]]></title>
            <link>https://medium.com/walmartglobaltech/custom-downscaler-for-trino-cluster-on-google-cloud-243f64112b86?source=rss-77446748f093------2</link>
            <guid isPermaLink="false">https://medium.com/p/243f64112b86</guid>
            <category><![CDATA[google-cloud-platform]]></category>
            <category><![CDATA[trinos]]></category>
            <category><![CDATA[engineering]]></category>
            <category><![CDATA[downscale]]></category>
            <category><![CDATA[presto]]></category>
            <dc:creator><![CDATA[Ayush Bilala]]></dc:creator>
            <pubDate>Mon, 19 Apr 2021 11:50:29 GMT</pubDate>
            <atom:updated>2021-04-19T12:16:07.722Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*hbs3J8_QF25KNNzPgQ4_iA.jpeg" /><figcaption>Source: <a href="https://github.com/trinodb/trino.io/blob/master/assets/trino-og.png">Trino</a>, <a href="https://cloud.google.com/press/">Google Cloud</a></figcaption></figure><h3>Overview</h3><p>We started our journey with Trino back in 2018 with a handful of users, with a primary objective to serve only ad-hoc queries. We were able to get 60x performance improvements when compared to Hive. This is when Trino’s adoption increased within Walmart. Different teams switched to Trino for different use-cases and they were all happy.</p><p>As of today thousands of dashboards, developed on several BI tools, are powered by Trino, and <strong>over 2K active users are running over a million queries every month, processing several petabytes of data daily</strong> on this platform.</p><p>Our Trino cluster is on GCP and used to run in Autoscale mode, which automatically adds or deletes virtual machine (VM) instances from a managed instance group based on an increase or decrease in cluster load. It also helped us in reducing the costs when the need for resources is lower. The only concerning downside of using GCP’s auto-scaler is the failure of tasks running on a host terminated by the auto-scaler.</p><p>Though a majority of our SQL queries finish well within 5–10 seconds, there are certain long-running queries that run for over 45 minutes. These long-running queries were the ones that got highly impacted because of the GCP virtual machine getting terminated by the GCP auto-scaler. There were frequent query failures because of this.</p><p>We wanted to offer a much more reliable and happy experience to our platform users meaning,</p><ul><li><strong>Zero query failure during cluster downscale</strong></li><li><strong>Minimal impact on query performance</strong></li></ul><p>At the same time, we wanted to <strong>make sure the Trino cluster is well utilized.</strong></p><h3>Problem of Autoscaling the Trino Cluster</h3><p>There isn’t any issue with Trino Cluster scaling up, but <strong>there is certainly an issue when running queries fail while the cluster scales down</strong>.</p><p>Even with the <a href="https://trino.io/docs/current/admin/graceful-shutdown.html"><strong>graceful shutdown</strong></a><strong> of the Trino worker</strong> during scale down, queries can fail if the query is launched just before shutdown and takes longer to run than the grace period of 90 seconds. The long-running queries are no different.</p><p>Say, a user submits a SQL query, it runs for 45 minutes and fails just because the cluster downscaled! The only option left with the user is to retry running the query and wait for another 45 minutes with the hope that the query will run successfully this time.</p><p>This adds a bad taste to the entire user experience and certainly creates a lot of noise in any organization.</p><p>In a nutshell, below are the two major concerns that we wanted to address:</p><ul><li>Random worker node termination by GCP auto-scaler leading to frequent query failures</li><li>Waste of cluster resources when a query running for say, over 45 minutes and gets failed because one of the nodes was taken away by GCP auto-scaler</li></ul><p>To avoid all these issues, we decided to manage the cluster downscaling ourselves and let GCP take care of only Scaling UP the cluster.</p><h3>The Birth of Custom Down-Scaler</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/763/1*AzuqrKn3J5Arptttq0jn2g.png" /><figcaption>Different strategies that we adopted to resolve the cluster down-scale issue</figcaption></figure><p>When we first saw this issue, we decided to switch to a static cluster from an Autoscaling cluster. We used to tweak the cluster bounds twice at specific times of the day based on the cluster load. But, this was only an interim approach and obviously not the very efficient and cost-effective one. Our users were happy as they stopped seeing the <strong>PAGE_TRANSPORT_ERROR</strong>, <strong>REMOTE_HOST_GONE</strong>, and <strong>TOO_MANY_REQUESTS_FAILED</strong> errors. The cluster was in a much more reliable state.</p><p>As a next step, we switched to running the cluster in <strong>Autoscale Only UP</strong> mode where GCP takes care of only scaling up the cluster. We used to resize the cluster forcefully once every day so as so to make sure we do not waste cluster resources during off-peak hours.</p><p>Even this wasn’t the best of solutions as our cluster used of scale-up really fast as and when there is a sudden load on the cluster but only gets downscaled once during off-peak hours, meaning <strong>cluster used to run with the upper bound for at least 10–12 hours even when the load has reduced</strong>.</p><p>This is the time we decided to write a custom down-scaler. We allow GCP to only scale up the instances based on CPU utilization. Scale down is taken care of by us. We solved the problem by gracefully scaling down the Trino workers.</p><h3>How the Custom Down-scaler works?</h3><p>Custom down-scaler looks at various metrics like overall CPU utilization, memory utilization, running query count, and queued query count to decide whether the downscale operation can be triggered.</p><p>As soon as the custom down-scaler sees an opportunity to scale down the cluster, it sends a shutdown signal to the Trino workers.</p><p>The Trino Worker then enters a special state in which it</p><ol><li>stops serving new requests,</li><li>continues processing the current query tasks that were scheduled on it and,</li><li>shuts down after finishing that work.</li></ol><p>Custom down-scaler continuously polls for the running tasks count on the Trino workers. As soon as the count drops down to zero, the custom down-scaler marks the virtual machine for termination.</p><h3>This is not the end of the Story</h3><p>Along with custom down-scaler running 24/7 we have also adopted an approach of <strong>scheduled down-scaler</strong>. During off-peak hours, our Trino cluster load drops significantly.</p><p>Say, during the peak business hours, the cluster is running with full capacity and the load drops, the down-scaler will take few hours to downscale the cluster to a smaller/appropriate size. Rather than only relying on a custom down-scaler to downscale the cluster, a scheduled down-scaler runs and does a forceful resize of the Trino cluster by resizing the GCP instance group.</p><p>We make sure when the resize operation is performed, there are no or only a handful of queries running on the cluster so that there isn’t a huge impact.</p><h3>How did it help?</h3><p>Well, we managed to <strong>reduce our monthly spend on Trino infrastructure by almost 50%</strong>, without compromising on user experience. Cluster is well utilized almost all the time.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*r0m-uLQw07KEqo_2Ke8AHw.png" /><figcaption>Source: <a href="https://cloud.google.com/">GCP</a> Trino Cluster CPU Utilization (<strong>Before Custom Downscaler</strong>)</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*GGT-jNqq6pMzwqUxgmtVRQ.png" /><figcaption>Source: <a href="https://cloud.google.com/">GCP</a> Trino Cluster CPU Utilization (<strong>After Custom Downscaler</strong>)</figcaption></figure><p>Screenshots above depict the cluster utilization before and after the introduction of a custom down-scaler. It is evident that the cluster utilization was very inconsistent, at times even less than 30% before the introduction of down-scaler. It improved a lot and is consistently around 80% almost all the time after the custom down-scaler came into the picture.</p><p>We do not see any more query failures while cluster downscaling.</p><p><strong>Happy business, Happy we!</strong></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=243f64112b86" width="1" height="1" alt=""><hr><p><a href="https://medium.com/walmartglobaltech/custom-downscaler-for-trino-cluster-on-google-cloud-243f64112b86">Custom Downscaler For Trino Cluster on Google Cloud</a> was originally published in <a href="https://medium.com/walmartglobaltech">Walmart Global Tech Blog</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Presto on Google Cloud Platform]]></title>
            <link>https://medium.com/walmartglobaltech/presto-on-google-cloud-platform-d3c2187c4880?source=rss-77446748f093------2</link>
            <guid isPermaLink="false">https://medium.com/p/d3c2187c4880</guid>
            <category><![CDATA[walmart]]></category>
            <category><![CDATA[cloud]]></category>
            <category><![CDATA[engineering]]></category>
            <category><![CDATA[google-cloud-platform]]></category>
            <category><![CDATA[presto]]></category>
            <dc:creator><![CDATA[Ayush Bilala]]></dc:creator>
            <pubDate>Mon, 23 Dec 2019 16:29:46 GMT</pubDate>
            <atom:updated>2019-12-23T16:29:46.118Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/980/1*6LK268boWm-zSiVNjQIzhg.png" /><figcaption>Source: <a href="https://github.com/prestosql/presto/blob/master/presto-docs/src/main/resources/logo/web/main/black/Presto_Logo_BlackBG-01.svg">Presto</a>, <a href="https://cloud.google.com/press/">Google Cloud</a></figcaption></figure><p>Presto is undoubtedly the fastest growing distributed SQL query engine and uses an architecture similar to a classic massively parallel processing (MPP) database management system.</p><p>Presto can be deployed on many different platforms and locations. Whether in the cloud or on-premises, the technology is truly platform agnostic. Combining Presto with the cloud computing services provided by GCP allows you to never get deprived of resources and continue to gain useful insights out of your data.</p><p>This article talks about setting up 3 nodes automated <strong>autoscaling</strong> <strong>Presto</strong> cluster on <strong>Google Cloud Platform</strong>. We’ll be making use of <a href="https://cloud.google.com/compute/docs/">Google Compute Engine</a>, <a href="https://cloud.google.com/compute/docs/instance-groups/">Instance Group</a> and <a href="https://cloud.google.com/compute/docs/autoscaler/">Autoscaler</a>.</p><p><strong>Disclaimer</strong>: Presto configuration used here is definitely not suitable for production setup by all means. You can follow the article for a quick development environment setup.</p><h3>Environment</h3><ol><li>We need 3 virtual machines, one for Presto coordinator and two for Presto workers</li><li>Set Presto on all the machines</li><li>Create a Presto worker image and template</li><li>Create Presto worker Managed Instance Group</li><li>Set auto-scaling policy</li><li>Validate the setup</li></ol><h3>Let’s start with 3VMs</h3><p>We need at the very least 3 virtual machines, one for Presto coordinator and 2 for Presto workers.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/5f5d6e811f77d3bd9d5042fda9b000d5/href">https://medium.com/media/5f5d6e811f77d3bd9d5042fda9b000d5/href</a></iframe><h3>Install Java</h3><p>Well, you need to install Java on both coordinator and workers. Presto needs minimum Java 8, though I recommend you to use Java 11 for better GC.</p><p><strong><em>How to install Java??</em></strong> There are tons of articles available on the internet on setting up Java. Follow one and get it installed.</p><h3>Next, Configure Presto Coordinator</h3><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/f28b2f60a1a05f750b9e784157d19b71/href">https://medium.com/media/f28b2f60a1a05f750b9e784157d19b71/href</a></iframe><h3>Start the Coordinator</h3><p>At this very point in time, you are all set with your Presto coordinator. Run the Presto launcher script and check the Presto UI at <a href="http://{coordinator_ip}:8080/">http://{coordinator_ip}:8080</a></p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/94a44a97d5078aec2c4f3daea2ecb9b6/href">https://medium.com/media/94a44a97d5078aec2c4f3daea2ecb9b6/href</a></iframe><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*axfNodTrKxFd6Vlc4IngqQ.png" /><figcaption>Presto UI: <a href="http://{coordinator_ip}:8080/">http://{coordinator_ip}:8080</a></figcaption></figure><h3>Hey! Aren’t we missing something?</h3><p>As you can see in Presto UI, the Active Workers count is 0. We have not yet set the Presto workers!! Let’s set them up next.</p><p>Steps 1 and 2 are the same as coordinator setup instructions. Step 3 is what makes workers different from the coordinator.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/2e7d12c2964a964209b8775203f3e90b/href">https://medium.com/media/2e7d12c2964a964209b8775203f3e90b/href</a></iframe><h3>Next...Create Managed Instance Group for Workers</h3><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/8aa9cd3ce47a5fcb36ae26ad79af00e8/href">https://medium.com/media/8aa9cd3ce47a5fcb36ae26ad79af00e8/href</a></iframe><p>At this point in time, if you go refresh the Presto UI webpage, below is what you’ll see!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*gNJcXZu_VESuaiiZKnTkRA.png" /><figcaption>Presto UI: <a href="http://{coordinator_ip}:8080/">http://{coordinator_ip}:8080</a></figcaption></figure><p>Voila! We have a Presto cluster ready.</p><h3>Let’s continue playing around and set auto-scaling</h3><p>Autoscaling helps your applications gracefully handle increases in traffic and reduce costs when the need for resources is lower.</p><p>Per the below autoscaling policy, GCP will add upto 10 instances to your instance group when there is more load (upscaling), and delete instances when the need for instances is lowered (downscaling).</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/56391ffb42536c88f47f55f6e89a710a/href">https://medium.com/media/56391ffb42536c88f47f55f6e89a710a/href</a></iframe><h3>What about Presto CLI?</h3><p>You can make use of Presto CLI to query the data from Presto. We have configured the JMX catalog, so you can query JMX metrics.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/efe556eec02666bb43274cefda8dc02e/href">https://medium.com/media/efe556eec02666bb43274cefda8dc02e/href</a></iframe><figure><img alt="" src="https://cdn-images-1.medium.com/max/681/1*xpQ3ZftFjkOvZhmsjkn2Aw.png" /><figcaption>Presto CLI</figcaption></figure><p>If you want to connect to Hive, which most probably you will, go ahead and configure a hive catalog and restart the cluster.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/e2d307d5d6f751792aa17f8980d2efc7/href">https://medium.com/media/e2d307d5d6f751792aa17f8980d2efc7/href</a></iframe><p>Now that the Hive catalog is configured, let’s query Hive data from Presto CLI.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/796/1*JQs32hnmrT1aOOkAZwYpFg.png" /><figcaption>Presto CLI</figcaption></figure><h3>CLI is not the only option!</h3><p>Presto gives you the freedom to use the BI tools that work best for you. You can choose any BI tool of your own choice. It could be Superset, Tableau, Power BI, Zeppelin, Jupyter notebook, and the list goes on...</p><p>Well..this is it. You have autoscaling enabled Presto cluster set on GCP for all your analytical needs.</p><p><strong>Stay tuned</strong> for an amazing insight into Presto on GCP as I am planning to come with more such posts.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=d3c2187c4880" width="1" height="1" alt=""><hr><p><a href="https://medium.com/walmartglobaltech/presto-on-google-cloud-platform-d3c2187c4880">Presto on Google Cloud Platform</a> was originally published in <a href="https://medium.com/walmartglobaltech">Walmart Global Tech Blog</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
    </channel>
</rss>