浏览代码

v0.3.0-unstable10

Yann Stepienik 2 年之前
父节点
当前提交
ac3a53507d
共有 2 个文件被更改,包括 4 次插入4 次删除
  1. 1 1
      package.json
  2. 3 3
      src/proxy/shield.go

+ 1 - 1
package.json

@@ -1,6 +1,6 @@
 {
   "name": "cosmos-server",
-  "version": "0.3.0-unstable9",
+  "version": "0.3.0-unstable10",
   "description": "",
   "main": "test-server.js",
   "bugs": {

+ 3 - 3
src/proxy/shield.go

@@ -186,7 +186,7 @@ func (shield *smartShieldState) computeThrottle(policy utils.SmartShieldPolicy,
 	overSim := policy.PerUserSimultaneous - userConsumed.Simultaneous
 	overSimRatio := float64(overSim) / float64(policy.PerUserSimultaneous)
 	if overSim < 0 {
-		newThrottle := int(float64(20) * -overSimRatio)
+		newThrottle := int(float64(50) * -overSimRatio)
 		if newThrottle > throttle {
 			throttle = newThrottle
 		}
@@ -240,10 +240,10 @@ func SmartShieldMiddleware(policy utils.SmartShieldPolicy) func(http.Handler) ht
 			policy.PolicyStrictness = 2 // NORMAL
 		}
 		if(policy.PerUserSimultaneous == 0) {
-			policy.PerUserSimultaneous = 10
+			policy.PerUserSimultaneous = 24
 		}
 		if(policy.MaxGlobalSimultaneous == 0) {
-			policy.MaxGlobalSimultaneous = 200
+			policy.MaxGlobalSimultaneous = 250
 		}
 		if(policy.PrivilegedGroups == 0) {
 			policy.PrivilegedGroups = utils.ADMIN