4
pyspark 코드에서 프로파일 링을 이해하고 싶습니다. 이 다음pyspark 작업 프로파일 링 방법
: https://github.com/apache/spark/pull/2351
>>> sc._conf.set("spark.python.profile", "true")
>>> rdd = sc.parallelize(range(100)).map(str)
>>> rdd.count()
100
>>> sc.show_profiles()
============================================================
Profile of RDD<id=1>
============================================================
284 function calls (276 primitive calls) in 0.001 seconds
Ordered by: internal time, cumulative time
ncalls tottime percall cumtime percall filename:lineno(function)
4 0.000 0.000 0.000 0.000 serializers.py:198(load_stream)
4 0.000 0.000 0.000 0.000 {reduce}
12/4 0.000 0.000 0.001 0.000 rdd.py:2092(pipeline_func)
4 0.000 0.000 0.000 0.000 {cPickle.loads}
4 0.000 0.000 0.000 0.000 {cPickle.dumps}
104 0.000 0.000 0.000 0.000 rdd.py:852(<genexpr>)
8 0.000 0.000 0.000 0.000 serializers.py:461(read_int)
12 0.000 0.000 0.000 0.000 rdd.py:303(func)
이상 잘 작동합니다. 그러나 아래처럼 뭔가를하면 :
from pyspark.sql import HiveContext
from pyspark import SparkConf
from pyspark import SparkContext
conf = SparkConf().setAppName("myapp").set("spark.python.profile","true")
sc = SparkContext(conf=conf)
sqlContext = HiveContext(sc)
df=sqlContext.sql("select * from myhivetable")
df.count()
sc.show_profiles()
이것은 아무 것도주지 않습니다. 나는 수를 얻을 수 있지만, show_profiles()
나 None
이 어떤 도움이
프로필을 작성하려고하는 복잡한 pyspark 작업이 있습니다. 그럼 뭐야? 표준 솔루션? – sau
JVM 코드 (예 : VisualVM)와 Python을 별도로 프로파일 링해야하지만 쉽지 않습니다. –