1
votes

I am a newbie to Spark Streaming and I have some doubts regarding the same like

  1. Do we need always more than one executor or with one we can do our job
  2. I am pulling data from kafka using createDirectStream which is receiver less method and batch duration is one minute , so is my data is received for one batch and then processed during other batch duration or it is simultaneously processed
  3. If it is processed simultaneously then how is it assured that my processing is finished in the batch duration
  4. How to use the that web UI to monitor and debugging
2

2 Answers

0
votes

Do we need always more than one executor or with one we can do our job

It depends :). If you have a very small volume of traffic coming in, it could very well be that one machine code suffice in terms of load. In terms of fault tolerance that might not be a very good idea, since a single executor could crash and make your entire stream fault.

I am pulling data from kafka using createDirectStream which is receiver less method and batch duration is one minute , so is my data is received for one batch and then processed during other batch duration or it is simultaneously processed

Your data is read once per minute, processed, and only upon the completion of the entire job will it continue to the next. As long as your batch processing time is less than one minute, there shouldn't be a problem. If processing takes more than a minute, you will start to accumulate delays.

If it is processed simultaneously then how is it assured that my processing is finished in the batch duration?

As long as you don't set spark.streaming.concurrentJobs to more than 1, a single streaming graph will be executed, one at a time.

How to use the that web UI to monitor and debugging

This question is generally too broad for SO. I suggest starting with the Streaming tab that gets created once you submit your application, and start diving into each batch details and continuing from there.

0
votes

To add a bit more on monitoring

How to use the that web UI to monitor and debugging

Monitor your application in the Streaming tab on localhost:4040, the main metrics to look for are Processing Time and Scheduling Delay. Have a look at the offical doc : http://spark.apache.org/docs/latest/streaming-programming-guide.html#monitoring-applications

batch duration is one minute

Your batch duration a bit long, try to adjust it with lower values to improve your latency. 4 seconds can be a good start.

Also it's a good idea to monitor these metrics on Graphite and set alerts. Have a look at this post https://stackoverflow.com/a/29983398/3535853