Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
Building Python Real time Applications with Storm

You're reading from   Building Python Real time Applications with Storm Learn to process massive real-time data streams using Storm and Python—no Java required!

Arrow left icon
Product type Paperback
Published in Dec 2015
Publisher
ISBN-13 9781784392857
Length 122 pages
Edition 1st Edition
Languages
Tools
Arrow right icon
Toc

Tuning parallelism in Storm – scaling a distributed computation

To explain parallelism of Storm, we will configure three parameters:

  • The number of workers
  • The number of executors
  • The number of tasks

The following figure gives a diagrammatic explanation of an example where we have a topology with just one spout and one bolt. In this case, we will set different values for the numbers of workers, executors, and tasks at the spout and bolt levels, and see how parallelism works in each case:

Tuning parallelism in Storm – scaling a distributed computation
// assume we have two workers in total for topology.
topology.workers: 2
 // just one executor of spout.
builder.setSpout("spout-sentence", TwitterStreamSpout(),1)

// two executors of bolt.
builder.setBolt("bolt-split", SplitSentenceBolt(),2)
 // four tasks for bolts.
.setNumTasks(4)
.shuffleGrouping("spout-sentence");

For this configuration, we will have two workers, which will run in separate JVMs (worker 1 and worker 2).

For the spout, there is one executor, and the default...

lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $19.99/month. Cancel anytime
Banner background image