-
Notifications
You must be signed in to change notification settings - Fork 28.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[SPARK-9103][WIP] Add Memory Tracking UI and track Netty memory usage #17625
Conversation
Manual pull of the PR from: https://github.com/apache/spark/pull/7753/commits Created with: git checkout upstream/pr/7753 -- . A bunch of manual merging happened after this.
@@ -22,8 +22,12 @@ import java.nio.ByteBuffer | |||
import scala.collection.JavaConverters._ | |||
import scala.concurrent.{Future, Promise} | |||
import scala.reflect.ClassTag | |||
import scala.tools.nsc.interpreter.JList |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this should be
import java.util.{List => JList}
(it happens to work b/c of this: https://github.com/scala/scala/blob/v2.12.1/src/repl/scala/tools/nsc/interpreter/package.scala#L36)
@@ -87,6 +88,10 @@ private[spark] class EventLoggingListener( | |||
// Visible for tests only. | |||
private[scheduler] val logPath = getLogPath(logBaseDir, appId, appAttemptId, compressionCodecName) | |||
|
|||
private val executorIdToLatestMetrics = new HashMap[String, SparkListenerExecutorMetricsUpdate] | |||
private val executorIdToModifiedMaxMetrics = new | |||
HashMap[String, SparkListenerExecutorMetricsUpdate] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: put new
on same line as hashMap
case None => | ||
executorIdToModifiedMaxMetrics(executorId) = latestEvent | ||
case Some(toBeModifiedEvent) => | ||
val toBeModifiedTransportMetrics = toBeModifiedEvent.executorMetrics.transportMetrics |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
how about prevTransportMetrics
} else { | ||
toBeModifiedTransportMetrics.offHeapSize | ||
} | ||
val modifiedExecMetrics = ExecutorMetrics(toBeModifiedEvent.executorMetrics.hostname, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
how about updatedExecMetrics
Jenkins, ok to test |
Test build #75750 has finished for PR 17625 at commit
|
@jsoltren thanks to bring up this very old PR. By looking at the UI you pasted here, I'm wondering what is the usage of Also I think it would be better to to add a new Metrics Source about Netty memory usage, that would be useful. |
we also just exposed more memory information for storage memory in the executors page in SPARK-17019. If we now have a memory tab it could be confusing to the users where to go to see what. If this is again a per executor thing do we just add new columns which check boxes there or consider consolidating that information under this memory tab? |
val newJson = JsonProtocol.executorMetricsUpdateToJson(executorMetricsUpdate) | ||
val oldJson = newJson.removeField { case (field, _) => field == "Executor Metrics Updated"} | ||
val newMetrics = JsonProtocol.executorMetricsUpdateFromJson(oldJson) | ||
assert(newMetrics.executorMetrics.hostname === "") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it seems like really executorMetrics
should be an Option
(with a comment that it was not present till version x)
yeah taking another look at the UI, I agree with @jerryshao and @tgravescs, the memory tab is pretty weird. I think putting this info on the "stages" tab makes sense -- that is really the info that this is currently exposing, the memory used by netty during a stage. I think at some point it might make sense to have a Memory tab which more completely summarizes the memory used by spark -- netty, cache, shuffle, execution, perhaps even parquet & serialization buffers, etc. But with just this, its more confusing than it is helpful. It may be a little strange having just this one bit of memory info on the stage page until we get a more complete picture of memory, but hopefully still useful. Also having a metric source for netty seems like a good idea. |
@tgravescs what do you think about breaking this into two parts -- the internal plumbing, and the UI stuff? by itself the plumbing part wouldn't do anything, but I think it would be easier to review, as long as there is general agreement this is a good direction. |
I haven't looked through the code at all, but I definitely like the idea of tracking the netty memory usage. Breaking into 2 pieces makes sense. If we end up creating any new UI pages please use datatables like the executors page rather then the old format. |
Test build #75857 has finished for PR 17625 at commit
|
@jsoltren , a quick look at your current implementation, looks like you only track the Netty memory usage in
Also Spark has different Netty context (rpc, shuffle), shall we also need different netty metrics for shuffle, rpc...? I would suggest to only expose Netty metrics internally in this PR and get rid of UI things for the following PR. |
Closes apache#11785 Closes apache#13027 Closes apache#13614 Closes apache#13761 Closes apache#15197 Closes apache#14006 Closes apache#12576 Closes apache#15447 Closes apache#13259 Closes apache#15616 Closes apache#14473 Closes apache#16638 Closes apache#16146 Closes apache#17269 Closes apache#17313 Closes apache#17418 Closes apache#17485 Closes apache#17551 Closes apache#17463 Closes apache#17625 Closes apache#10739 Closes apache#15193 Closes apache#15344 Closes apache#14804 Closes apache#16993 Closes apache#17040 Closes apache#15180 Closes apache#17238
I'm still making updates here. It would be ideal if one of the admins could please re-open this PR. Otherwise I will open a new one. Thanks! |
This PR was closed, so, I'll create a new one focusing on just the back end pieces. I'll create a fresh JIRA for more general memory tracking improvements to the UI where we can hash out more of the details. The UI has changed quite a lot since the original PR! |
This pr proposed to close stale PRs. Currently, we have 400+ open PRs and there are some stale PRs whose JIRA tickets have been already closed and whose JIRA tickets does not exist (also, they seem not to be minor issues). // Open PRs whose JIRA tickets have been already closed Closes apache#11785 Closes apache#13027 Closes apache#13614 Closes apache#13761 Closes apache#15197 Closes apache#14006 Closes apache#12576 Closes apache#15447 Closes apache#13259 Closes apache#15616 Closes apache#14473 Closes apache#16638 Closes apache#16146 Closes apache#17269 Closes apache#17313 Closes apache#17418 Closes apache#17485 Closes apache#17551 Closes apache#17463 Closes apache#17625 // Open PRs whose JIRA tickets does not exist and they are not minor issues Closes apache#10739 Closes apache#15193 Closes apache#15344 Closes apache#14804 Closes apache#16993 Closes apache#17040 Closes apache#15180 Closes apache#17238 N/A Author: Takeshi Yamamuro <yamamuro@apache.org> Closes apache#17734 from maropu/resolved_pr. Change-Id: Id2e590aa7283fe5ac01424d30a40df06da6098b5
This patch resurrects #7753 by liyezhang556520.
What changes were proposed in this pull request?
Memory reporting is a much desired feature in Apache Spark. This change adds reporting for some memory used by netty, and adds a new UI tab for memory reporting. We introduce a new executorMetrics object to track this.
How was this patch tested?
Ran https://github.com/jsoltren/spark-demos/blob/master/src/main/scala/org/soltren/spark/examples/ShuffleGroupCount.scala and verified appearance of new tab in UI.