spark streaming限制吞吐


使用spark.streaming.receiver.maxRate這個屬性限制每秒的最大吞吐。官方文檔如下:

Maximum rate (number of records per second) at which each receiver will receive data. Effectively, each stream will consume at most this number of records per second. Setting this configuration to 0 or a negative number will put no limit on the rate. See the deployment guide in the Spark Streaming programing guide for mode details.

默認沒有設置,也就是做沒做限制。

如果做限制100,那么每秒最大吞吐就是100條。

 

然后文檔中還有一個屬性spark.streaming.kafka.maxRatePerPartition,也是限制吞吐的,不過是限制kafka讀取的速度,官方文檔是這么說的:

Maximum rate (number of records per second) at which data will be read from each Kafka partition when using the new Kafka direct stream API. See the Kafka Integration guide for more details.

默認也是沒有設置。

現在還搞不清楚這兩個的關聯。  這個需要去研究源代碼。 猜想spark.streaming.receiver.maxRate是限制除kafka以外的吞吐,而spark.streaming.kafka.macRatePerPartition的吞吐。


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM