Storm (v) topological parallelism

Source: Internet
Author: User
Tags config

Apache Storm distributed cluster main node consists of control node (Nimbus node) and working node (Supervisor node), one worker node running one or more worker processes, worker is a subset of topology, Topology corresponds to one or more worker.

Topology is mainly composed of worker, Executor, task, topology corresponds to one or more workers (is a separate JVM process), and there are multiple Executor threads under the worker. Executor corresponds to one or more tasks, by default a executor corresponds to a task (Spout\bolt), and these tasks are the same Spout\bolt component.


Official


When we create the topology, we configure the number of workers, the number of executor, the number of tasks, that is, the degree of parallelism, improve the degree of parallelism of the topology, can improve the computing power of the topology.

Description

Number of worker: Conf.setnumworkers (num)/config.topology_workers

Number of Executor: Builder.setbolt ()/builder.setspout ()

Number of tasks: Builder.setbolt (). Setnumtasks (Val)

We use the official example to further understand:



Code:

  Config conf = new config ();
  Conf.setnumworkers (2); Use of the worker processes
  topologybuilder.setspout ("Blue-spout", New Bluespout (), 2);//Set parallelism hint to 2
  topologybuilder.setbolt ("Green-bolt", New Greenbolt (), 2). Setnumtasks (4). shufflegrouping ("Blue-spout");
  Topologybuilder.setbolt ("Yellow-bolt", New Yellowbolt (), 6). Shufflegrouping ("Green-bolt");
  Stormsubmitter.submittopology ("Mytopology", Conf,topologybuilder.createtopology ());

Description

1) This topology has two worker processes (Conf.setnumworkers (2)).

2) Bluespout has two executor threads, and each executor corresponds to a task.

3) Greenbolt has two executor threads, each executor corresponding to two tasks.

4) Yellowbolt has six executor threads, and each executor corresponds to a task.

The total degree of parallelism for this topology is 2 + 2 + 6 = 10, which is assigned to each worker with 10/2 = 5 executor.

Bluespout degree of parallelism is 2, Greenbolt degree of parallelism is 2, Yellowbolt is six, improve the degree of parallelism of topology, can improve the computing ability of topology.



With the Storm's demo example, we can see in the Storm UI the topology of two worker,executors, the parallelism of each bolt\spout information




Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.