lith před 4 roky
rodič
revize
084b0b7030

+ 58 - 3
dotnet/Doc/Publish/echo qps.md

@@ -18,6 +18,8 @@ for i in {1..100}; do curl -s -H "Cookie: user=admin_123456" http://localhost:45
 
 
 
+#----------------------------------------------
+# sers单体压测(net6.0)
 
 dotnet /root/app/ServiceCenter/App.ServiceCenter.dll 
 
@@ -26,14 +28,18 @@ http://127.0.0.1:4580/_gover_/index.html?user=admin_123456
 
 
 
-#----------------------------------------------
-# sers单体压测(net6.0)
 
 CentOs8(2x24核) .net6
 
+Sers.CL.workThreadCount			1
+Sers.CL.Client-Iocp.Mode		Simple
+Sers.RpcDataSerializeMode		BytePointor
+Sers.LocalApiService.workThreadCount	{workThread}
+Vit.ConsumerMode			ConsumerCache_BlockingCollection
+
 
 方式 线程数(处理/请求)	qps(cpu利用率)
-type workThread/requestThread	qps(cpu利用率)
+    workThread/requestThread
 
 
 ApiClientAsync 16/16	140-150万(15%)   
@@ -49,3 +55,52 @@ ApiClientAsync 24/24	160-180
 
 
 
+#----------------------------------------------
+# sers分布式压测(net6.0)
+
+dotnet /root/app/ServiceCenter/App.ServiceCenter.dll 
+
+ 
+
+
+dotnet /root/app/Demo/Did.SersLoader.Demo.dll  > console.log 2>&1 &
+
+
+dotnet /root/app/Robot/App.Robot.Station.dll  > console.log 2>&1 &
+
+
+#杀死进程
+kill -s 9 `pgrep -f 'dotnet'`
+
+
+
+
+
+CentOs8(2x24核) .net6
+
+
+# ServiceCenter:
+
+Sers.CL.workThreadCount			4
+Sers.CL.Client-Iocp.Mode		Timer
+Sers.RpcDataSerializeMode		BytePointor
+Sers.LocalApiService.workThreadCount	4
+Vit.ConsumerMode			ConsumerCache_BlockingCollection
+
+
+
+# Demo and Robot
+
+Sers.CL.workThreadCount			2
+Sers.CL.Client-Iocp.Mode		Timer
+Sers.RpcDataSerializeMode		BytePointor
+Sers.LocalApiService.workThreadCount	20
+Vit.ConsumerMode			ConsumerCache_BlockingCollection
+
+
+
+
+方式 线程数(处理/请求)	qps(cpu利用率-服务端 客户端)
+    workThread/requestThread	
+
+ApiClientAsync 20/5000		18-20万(20% 14%)   

+ 4 - 4
dotnet/Doc/PublishFile/Sers压测/分布式压测/Demo/appsettings.json

@@ -72,7 +72,7 @@
           "className": "Sers.CL.Socket.Iocp.OrganizeClientBuilder",
 
           /* 通信模式(默认值:Simple)。可为 Simple、Timer、SpinWait  */
-          //"mode": "Timer",
+          "mode": "Timer",
 
           /* 接收缓存区大小(单位:byte,默认:8192)  */
           //"receiveBufferSize": 8192,
@@ -168,14 +168,14 @@
     // RpcData序列化模式。可不指定。默认为Text。
     // 可为 Newtonsoft、Text、BytePointor。
     // 效率依次递增。BytePointor 序列化为二进制数据而不是json字符串。
-    "RpcDataSerializeMode": "Text",
+    "RpcDataSerializeMode": "BytePointor",
 
 
     /* LocalApiService 配置,可不指定 */
     "LocalApiService": {
 
       /* 后台服务的线程个数(单位个,默认0,代表不开启服务)*/
-      "workThreadCount": 4,
+      "workThreadCount": 20,
 
       /* 超时时间,若不指定则后台任务永不超时。(主动关闭超过此时间的任务,实际任务强制关闭的时间会在1倍超时时间到2倍超时时间内)。单位:ms。*/
       //"timeout_ms": 300000,
@@ -357,7 +357,7 @@
     },
 
     /* 队列模式,可不指定。可为 BlockingCollection(默认)、 ConsumerCache_BlockingCollection(高性能) */
-    "ConsumerMode": "BlockingCollection",
+    "ConsumerMode": "ConsumerCache_BlockingCollection",
 
 
     /* 序列化配置,可不指定 */

+ 1 - 1
dotnet/Doc/PublishFile/Sers压测/分布式压测/Robot/Data/App.Robot.json

@@ -31,7 +31,7 @@
         "type": "ApiClientAsync",
         "name": "Async",
         "apiRoute": "/a",
-        "threadCount": 20,
+        "threadCount": 5000,
         "loopCountPerThread": 1000000000,
         "interval": 0,
         "autoStart": true,

+ 11 - 2
dotnet/Doc/PublishFile/Sers压测/分布式压测/Robot/appsettings.json

@@ -61,7 +61,7 @@
           "className": "Sers.CL.Socket.Iocp.OrganizeClientBuilder",
 
           /* 通信模式(默认值:Simple)。可为 Simple、Timer、SpinWait  */
-          //"mode": "Timer",
+          "mode": "Timer",
 
 
           /* (x.2) config */
@@ -143,12 +143,17 @@
       ]
     },
 
+    // RpcData序列化模式。可不指定。默认为Text。
+    // 可为 Newtonsoft、Text、BytePointor。
+    // 效率依次递增。BytePointor 序列化为二进制数据而不是json字符串。
+    "RpcDataSerializeMode": "BytePointor",
+
 
     /* LocalApiService 配置,可不指定 */
     "LocalApiService": {
 
       /* 后台服务的线程个数(单位个,默认0,代表不开启服务) */
-      "workThreadCount": 4,
+      "workThreadCount": 20,
 
       /* 静态文件映射器。映射站点静态文件,可多个,可不指定 */
       "staticFiles": [
@@ -200,6 +205,10 @@
       /* print the log to console. default:false  */
       "PrintToConsole": true
     }
+
+    /* 队列模式,可不指定。可为 BlockingCollection(默认)、 ConsumerCache_BlockingCollection(高性能) */
+    "ConsumerMode": "ConsumerCache_BlockingCollection"
+
   }
 
 

+ 4 - 4
dotnet/Doc/PublishFile/Sers压测/分布式压测/ServiceCenter/appsettings.json

@@ -9,7 +9,7 @@
         "requestTimeoutMs": 300000,
 
         /* 后台处理消息的线程个数(单位个,默认2) */
-        "workThreadCount": 2,
+        "workThreadCount": 4,
 
         //HeartBeat
         /* 心跳检测时间间隔(单位ms,默认10000,若指定为0则不进行心跳检测) */
@@ -67,7 +67,7 @@
           "className": "Sers.CL.Socket.Iocp.OrganizeServerBuilder",
 
           /* 通信模式(默认值:Simple)。可为 Simple、Timer、SpinWait  */
-          //"mode": "Timer",
+          "mode": "Timer",
 
           /* 接收缓存区大小(单位:byte,默认:8192)  */
           //"receiveBufferSize": 8192,
@@ -179,7 +179,7 @@
     // RpcData序列化模式。可不指定。默认为Text。
     // 可为 Newtonsoft、Text、BytePointor。
     // 效率依次递增。BytePointor 序列化为二进制数据而不是json字符串。
-    "RpcDataSerializeMode": "Text",
+    "RpcDataSerializeMode": "BytePointor",
 
 
 
@@ -535,7 +535,7 @@
     },
 
     /* 队列模式,可不指定。可为 BlockingCollection(默认)、 ConsumerCache_BlockingCollection(高性能) */
-    "ConsumerMode": "BlockingCollection",
+    "ConsumerMode": "ConsumerCache_BlockingCollection",
 
     /* 序列化配置,可不指定 */
     "Serialization": {