[
https://issues.apache.org/jira/browse/SPARK-7053?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14510751#comment-14510751
]
Platon Potapov edited comment on SPARK-7053 at 4/24/15 10:02 AM:
-----------------------------------------------------------------
"since you see OutOfMemoryError" - i don't see an error; i see an "out of
memory condition" - meaning that when scheduling delay builds up, so does the
pile of unprocessed RDDs (read from kafka) - they seem to pile up in memory up
to the point they no longer fit into it, and Spark begins flushing them to disk
instead (with a corresponding warning message in logs). Anyway, memory outage
occurs way after the processing time buildup (and is, apparently, caused by it)
Anyway, in addition to the [test
above|https://issues.apache.org/jira/browse/SPARK-7053?focusedCommentId=14507754&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-14507754]
in which a simplistic data transformation was subjected to 5000 msg/sec, i've
done an additional test with the same setup but with five times lower input
load - 1000 msg/sec. The complete source code of the spark job can be found in
[this
attachment|https://issues.apache.org/jira/secure/attachment/12727870/round2.scala]
* The results for the 5000 msg/sec test are depicted
[here|https://issues.apache.org/jira/secure/attachment/12727869/round2.5000msg.simple.jpg].
Note that average processing time at the outset of the test is about 5xx ms.
* The results for the 1000 msg/sec test are depicted
[here|https://issues.apache.org/jira/secure/attachment/12727868/round2.1000msg.simple.jpg].
Note that average processing time at the outset of the test is about 1xx ms.
Processing times at the outset of each tests seem to correlate with their
respective input load, which means that at least the 1000msg/sec test does not
have performance problems.
But both tests exhibit creep of processing time, just the more loaded test
crosses the 2-second boundary faster.
To me, this is clearly not an issue of performance, but a buildup of some
overhead (caused by kafka receiver). However, my limited expertise with the
kafka receiver does not allow me to tell the root cause.
Which course of action would you propose? Could probably the person owning the
kafka receiver take a look at the ticket, or execute the source code I provided
to reproduce the issue?
was (Author: minisaw):
"since you see OutOfMemoryError" - i don't see an error; i see an "out of
memory condition" - meaning that when scheduling delay builds up, so does the
pile of unprocessed RDDs (read from kafka) - they seem to pile up in memory up
to the point they no longer fit into it, and Spark begins flushing them to disk
instead (with a corresponding warning message in logs).
Anyway, in addition to the [test
above|https://issues.apache.org/jira/browse/SPARK-7053?focusedCommentId=14507754&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-14507754]
in which a simplistic data transformation was subjected to 5000 msg/sec, i've
done an additional test with the same setup but with five times lower input
load - 1000 msg/sec. The complete source code of the spark job can be found in
[this
attachment|https://issues.apache.org/jira/secure/attachment/12727870/round2.scala]
* The results for the 5000 msg/sec test are depicted
[here|https://issues.apache.org/jira/secure/attachment/12727869/round2.5000msg.simple.jpg].
Note that average processing time at the outset of the test is about 5xx ms.
* The results for the 1000 msg/sec test are depicted
[here|https://issues.apache.org/jira/secure/attachment/12727868/round2.1000msg.simple.jpg].
Note that average processing time at the outset of the test is about 1xx ms.
Processing times at the outset of each tests seem to correlate with their
respective input load, which means that at least the 1000msg/sec test does not
have performance problems.
But both tests exhibit creep of processing time, just the more loaded test
crosses the 2-second boundary faster.
To me, this is clearly not an issue of performance, but a buildup of some
overhead (caused by kafka receiver). However, my limited expertise with the
kafka receiver does not allow me to tell the root cause.
Which course of action would you propose? Could probably the person owning the
kafka receiver take a look at the ticket, or execute the source code I provided
to reproduce the issue?
> KafkaUtils.createStream leaks resources
> ---------------------------------------
>
> Key: SPARK-7053
> URL: https://issues.apache.org/jira/browse/SPARK-7053
> Project: Spark
> Issue Type: Bug
> Components: Streaming
> Affects Versions: 1.3.1
> Environment: Spark Streaming 1.3.1, standalone mode running on just 1
> box: Ubuntu 14.04.2 LTS, 4 cores, 8GB RAM, java version "1.8.0_40"
> Reporter: Platon Potapov
> Attachments: from.kafka.direct.stream.gif, from.kafka.receiver.gif,
> from.queue.gif, round2.1000msg.simple.jpg, round2.5000msg.simple.jpg,
> round2.scala
>
>
> I have a simple spark streaming application that reads messages from a Kafka
> topic, applies trivial transforms (window, map, mapValues, foreachRDD), and
> throws away the results. A test application, really. Streaming batch duration
> is 2 seconds.
> The kafka topic is steadily populated by 5000 messages each second by a data
> generator application. Each message is small (a few double values).
> The problem:
> * in case KafkaUtils.createStream is used to create a receiver fetching
> messages from Kafka, "Processing Time" (as seen at
> http://localhost:4040/streaming) starts with hundreds of milliseconds, but
> steadily increases over time, eventually resulting in scheduling delays and
> out of memory. Note that memory consumption (by the JVM) and garbage
> collection pauses grow over time.
> * in case KafkaUtils.createDirectStream is used (the rest of the setup is
> exactly the same), processing time starts at about 5 second (compare to
> hundreds of milliseconds in case of kafka receiver), but remains at this
> level.
> * in case the input is substituted to an in-memory queue populated by the
> same messages at the same rate (streamingContext.queueStream(queue)),
> processing time is again hundreds of milliseconds, and remains stable.
> This leads me to conclude that the setup with KafkaUtils.createStream
> receiver leaks resources.
> Attached are the graphs depicting each of the three scenarios.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]