2015-06-02 98 views
0

基於我的用例,我想爲每個項目ID創建一個Akka Actor。這樣,每個項目動作都由一個和一個線程/ actor執行,但可以同時執行併發項目。但是我偶然發現如何配置我的系統的線程數,因爲我可能有1000個項目同時進入,並且想要使用一些最大數量的線程,例如20來服務1000個項目。這可能與Akka。AKKA線程池配置

感謝, 拉維

回答

1

基礎上Docs,你應該嘗試在你的阿卡配置這些參數:

# This will be used if you have set "executor = "fork-join-executor"" 
fork-join-executor { 
    # Min number of threads to cap factor-based parallelism number to 
    parallelism-min = 8 

    # The parallelism factor is used to determine thread pool size using the 
    # following formula: ceil(available processors * factor). Resulting size 
    # is then bounded by the parallelism-min and parallelism-max values. 
    parallelism-factor = 3.0 

    # Max number of threads to cap factor-based parallelism number to 
    parallelism-max = 64 

} 

我假設你沒有改變你的默認執行參數,因爲如果你你是否已經知道在哪裏尋找。