Job-Scoped Hadoop Clusters with Google Cloud(cloud.google.com)
cloud.google.com
Job-Scoped Hadoop Clusters with Google Cloud
https://cloud.google.com/blog/big-data/2017/06/fastest-track-to-apache-hadoop-and-spark-success-using-job-scoped-clusters-on-cloud-native-architecture
19 comments
We're also doing this at Thumbtack. We run all of our Spark jobs in job-scoped Cloud Dataproc clusters. We wrote a custom Airflow operator which launches a cluster, schedules a job on that cluster, and shuts down the cluster upon job completion. Since Google can bring up Spark clusters in < 90s and bills minutely, this works really well for us, simplifying our infrastructure and eliminating resource contention issues.
Co-Author of the blog here.
Awesome stuff, glad to see folks leveraging the possibilities! Perhaps as a follow-up you could write a guest blog on how this works for you! Feel free to ping me offline.
Awesome stuff, glad to see folks leveraging the possibilities! Perhaps as a follow-up you could write a guest blog on how this works for you! Feel free to ping me offline.
Have you tried calculating what percentage increase in cost there would be if you moved to an aws billing style?
Basically I'm curious if your hands are tied to gcp because of the fine grained billing they provide?
Basically I'm curious if your hands are tied to gcp because of the fine grained billing they provide?
Hah, we were doing this with EMR 6 years ago, I guess we were a little early :)
https://www.youtube.com/watch?v=NF6zwHlbh_I
We built a coordinator that would spin up specific categories of machines for each stage (some stages were MR jobs, some were hadoop streaming jobs) -- for example when doing in-memory work it was useful to have fewer nodes with more RAM, etc.
https://www.youtube.com/watch?v=NF6zwHlbh_I
We built a coordinator that would spin up specific categories of machines for each stage (some stages were MR jobs, some were hadoop streaming jobs) -- for example when doing in-memory work it was useful to have fewer nodes with more RAM, etc.
Same here. Built a pooling algorithm so we can have a maximum number of pools for each job type and distribute more jobs onto them when the maximum is reached. Clusters shut down when idle. It's served us well and saved loads of time and money.
Cool! EMR takes minutes, though, to spin up a cluster, and the billing seems to be different and less convenient than GCP.
Didn't see the video, but what platform did you spin up the cluster on?
On any public cloud I have a hard time seeing this make financial sense other than Google, which bills by the minute.
On any public cloud I have a hard time seeing this make financial sense other than Google, which bills by the minute.
EMR = Aws
We're also looking at making this a bit easier with some API changes (additions, really) and work with other OSS projects, like Apache Airflow. Streaming is a very interesting use case; a focus for us as well. Keeping clusters running for months/years presents some interesting challenges.
Disclaimer - I'm the Cloud Dataproc PM. :)
Disclaimer - I'm the Cloud Dataproc PM. :)
interesting idea. I can see it being worthwhile with per-minute billing, which is not something supported by AWS. Also EMR charges a per-instance premium, does anyone know if Google Cloud does similar?
I'm curious how shuffle data is handled. Does the cluster intelligently scale down and move the shuffle data, or will the entire thing keep running while waiting for a single skewed reducer to finish? Or does the entire thing run on a single instance??
I'm curious how shuffle data is handled. Does the cluster intelligently scale down and move the shuffle data, or will the entire thing keep running while waiting for a single skewed reducer to finish? Or does the entire thing run on a single instance??
There is a per-core surcharge of basically $0.01 per hour [9]. And sadly Dataproc doesn't have a good autoscaling story.
On the flip side, you can use Preemptible VMs for Dataproc, which are 80% off, and Dataflow has an amazing auto-scaler
[77] https://cloud.google.com/blog/big-data/2017/01/understanding...
[9] https://cloud.google.com/dataproc/docs/resources/pricing
On the flip side, you can use Preemptible VMs for Dataproc, which are 80% off, and Dataflow has an amazing auto-scaler
[77] https://cloud.google.com/blog/big-data/2017/01/understanding...
[9] https://cloud.google.com/dataproc/docs/resources/pricing
(Disclaimer: work on Dataproc) Though Dataproc doesn't natively have an autoscaler, Spotify wrote one as part of Spydra: https://github.com/spotify/spydra
The autoscaler here doesn't solve the downscaling issues mentioned. We've seen it work fine for scaling up, quickly. For now we're not scaling down, as the job will finish quicker than individual tasks will time out when unlucky.
What about the traditional IO / data locality win of having your processing colocated with your DFS? Is GCS bandwidth that amazing?
Good question! You probably are familiar with the bandwidth and throughput power of the underlying storage system of GCS, Colossus, through use of BigQuery. BigQuery Storage and GCS storage both leverage Colossus. It's silly fast :)
Others can chime in more intelligently wrt Spark/Hadoop specifically, but I'll point out that read latency from GCS would definitely be higher than local-disk HDFS (esp Local SSD). Throughput, depending on your configuration, could be much better with GCS. Spark/Hadoop don't take the same care to optimize the storage-to-compute route as BigQuery, as evident by some bits of Hive performing serial FS operations.
So my answer is, it depends on the configuration of the job, the cluster, how data is written, choice of disk, and et cetera.
That said, when talking about price-performance, flexibility, scalability, and ease of operations, I suspect the "job-scoped clusters" setup would have a far superior TCO. We should try and do the math one day :)
(co-author of blog, work at G)
Others can chime in more intelligently wrt Spark/Hadoop specifically, but I'll point out that read latency from GCS would definitely be higher than local-disk HDFS (esp Local SSD). Throughput, depending on your configuration, could be much better with GCS. Spark/Hadoop don't take the same care to optimize the storage-to-compute route as BigQuery, as evident by some bits of Hive performing serial FS operations.
So my answer is, it depends on the configuration of the job, the cluster, how data is written, choice of disk, and et cetera.
That said, when talking about price-performance, flexibility, scalability, and ease of operations, I suspect the "job-scoped clusters" setup would have a far superior TCO. We should try and do the math one day :)
(co-author of blog, work at G)
Disclaimer - I'm the Cloud Dataproc PM. :)
Super good question.
For most use cases, GCS is going to give you better performance than using PD. GCS removes some headaches, like replication. In so doing, when you read from GCS you can often read from a large number of places in parallel; you're also less likely to run into bottlenecks because the VMs have pretty freaking amazing network bandwidth.
To be fair, there are some exceptions:
1: Small files (several KB to maybe 1MB) 2: Many reads
With GCS, you pay the tax for network overhead + SSL, which means reads are slower and scanning tons of small files can also be less performant.
For Cloud Dataproc, we also do provision HDFS on PD for intermediate output, because it's usually more cost effective than trying to do everything in GCS (which you can do, but you're going to pay for class A ops, and we want to save people money.)
To go into another level of detail, GCS also used to lack immediate list after write consistency. Now that GCS has been changing to support it, you also get a good story on clusters hitting the same bucket without hacks (in our case we used an NFS cache on the cluster.)
Dennis Huo, the tech lead manager for Dataproc also gave a pretty good talk covering some of this at Google Cloud Next [1]. I also gave a talk w/ Michael Yu on the GCS team [2] talking about a change we're in the process of making - swapping out the Java SSL provider with one from Conscrypt which nets about a 2x improvement in reads, making a great thing even better. :)
1: https://www.youtube.com/watch?v=NfxvjWSgplU 2: https://www.youtube.com/watch?v=SC_4qO-BIjc
Super good question.
For most use cases, GCS is going to give you better performance than using PD. GCS removes some headaches, like replication. In so doing, when you read from GCS you can often read from a large number of places in parallel; you're also less likely to run into bottlenecks because the VMs have pretty freaking amazing network bandwidth.
To be fair, there are some exceptions:
1: Small files (several KB to maybe 1MB) 2: Many reads
With GCS, you pay the tax for network overhead + SSL, which means reads are slower and scanning tons of small files can also be less performant.
For Cloud Dataproc, we also do provision HDFS on PD for intermediate output, because it's usually more cost effective than trying to do everything in GCS (which you can do, but you're going to pay for class A ops, and we want to save people money.)
To go into another level of detail, GCS also used to lack immediate list after write consistency. Now that GCS has been changing to support it, you also get a good story on clusters hitting the same bucket without hacks (in our case we used an NFS cache on the cluster.)
Dennis Huo, the tech lead manager for Dataproc also gave a pretty good talk covering some of this at Google Cloud Next [1]. I also gave a talk w/ Michael Yu on the GCS team [2] talking about a change we're in the process of making - swapping out the Java SSL provider with one from Conscrypt which nets about a 2x improvement in reads, making a great thing even better. :)
1: https://www.youtube.com/watch?v=NfxvjWSgplU 2: https://www.youtube.com/watch?v=SC_4qO-BIjc
Can anyone tell me how, as a sole developer, it's possible to gain real-world experience with distributed Hadoop and Spark given the massive computing resources required? It just seems like a closed shop to me.
Define "massive". You can learn all the most important aspects of the APIs and programming model on a single machine, either by running in "local" (non-distributed) mode or by running a few VMs to simulate a real cluster. And you can spin up a cluster of 100 machines on either AWS or GCE for about a dollar per hour.
GCP offers a $300 credit that expires after 1 year. It's a good way to get your feet wet with Hadoop and Spark via Cloud Dataproc. (Google Cloud employee speaking.)