Skip to content

Commit bde2fd1

Browse files
committed
use service.qos block to configure qos settings
1 parent 8099576 commit bde2fd1

File tree

2 files changed

+21
-14
lines changed

2 files changed

+21
-14
lines changed

custom/conf/app.example.ini

Lines changed: 15 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -927,15 +927,6 @@ LEVEL = Info
927927
;; Valid site url schemes for user profiles
928928
;VALID_SITE_URL_SCHEMES=http,https
929929
;;
930-
;; Enable request quality of service and load shedding.
931-
; QOS_ENABLED = false
932-
;; The number of requests that are in flight to service before queuing
933-
;; begins. Default is 4 * number of CPUs
934-
; QOS_MAX_INFLIGHT =
935-
;; The maximum number of requests that can be enqueued before they will be dropped.
936-
; QOS_MAX_WAITING = 100
937-
;; The target time for a request to be enqueued before it might be dropped.
938-
; QOS_TARGET_WAIT_TIME = 50ms
939930

940931
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
941932
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
@@ -956,6 +947,21 @@ LEVEL = Info
956947
;DISABLE_CODE_PAGE = false
957948
;;
958949

950+
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
951+
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
952+
;[service.qos]
953+
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
954+
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
955+
;; Enable request quality of service and load shedding.
956+
; ENABLED = false
957+
;; The number of requests that are in flight to service before queuing
958+
;; begins. Default is 4 * number of CPUs
959+
; MAX_INFLIGHT =
960+
;; The maximum number of requests that can be enqueued before they will be dropped.
961+
; MAX_WAITING = 100
962+
;; The target time for a request to be enqueued before it might be dropped.
963+
; TARGET_WAIT_TIME = 50ms
964+
959965
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
960966
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
961967
;; Other Settings

modules/setting/service.go

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -262,12 +262,13 @@ func loadServiceFrom(rootCfg ConfigProvider) {
262262

263263
mustMapSetting(rootCfg, "service.explore", &Service.Explore)
264264

265-
Service.QoS.Enabled = sec.Key("QOS_ENABLED").MustBool(false)
266-
Service.QoS.MaxInFlightRequests = sec.Key("QOS_MAX_INFLIGHT").MustInt(4 * runtime.NumCPU())
267-
Service.QoS.MaxWaitingRequests = sec.Key("QOS_MAX_WAITING").MustInt(100)
268-
Service.QoS.TargetWaitTime = sec.Key("QOS_TARGET_WAIT_TIME").MustDuration(50 * time.Millisecond)
269-
270265
loadOpenIDSetting(rootCfg)
266+
267+
qosSection := rootCfg.Section("service.qos")
268+
Service.QoS.Enabled = qosSection.Key("ENABLED").MustBool(false)
269+
Service.QoS.MaxInFlightRequests = qosSection.Key("MAX_INFLIGHT").MustInt(4 * runtime.NumCPU())
270+
Service.QoS.MaxWaitingRequests = qosSection.Key("MAX_WAITING").MustInt(100)
271+
Service.QoS.TargetWaitTime = qosSection.Key("TARGET_WAIT_TIME").MustDuration(50 * time.Millisecond)
271272
}
272273

273274
func loadOpenIDSetting(rootCfg ConfigProvider) {

0 commit comments

Comments
 (0)