stanley-king 3 years ago
parent
commit
9a05a8a5b0
2 changed files with 25 additions and 16 deletions
  1. 4 0
      docker/compose/xyzt/arw/docker-compose.yml
  2. 21 16
      server/comysqli.php

+ 4 - 0
docker/compose/xyzt/arw/docker-compose.yml

@@ -77,6 +77,10 @@ services:
       - /mnt/testlog:/var/www/html/data/log
     container_name: "panda-php"
 
+
+
+
+
   phpswoole:
     image: php-swool-redis:latest
     volumes:

+ 21 - 16
server/comysqli.php

@@ -27,7 +27,7 @@ class MysqliPoolTest
     {
         for ($i = 0; $i < 20; $i++)
         {
-            Log::record("cur index = {$i}",Log::DEBUG);
+            Log::record("setval index = {$i}",Log::DEBUG);
             go(function ()
             {
                 $mod_order = Model('vr_order');
@@ -43,7 +43,7 @@ class MysqliPoolTest
     {
         for ($i = 0; $i < 20; $i++)
         {
-            Log::record("cur index = {$i}",Log::DEBUG);
+            Log::record("readval index = {$i}",Log::DEBUG);
             go(function ()
             {
                 $mod_order = Model('vr_order');
@@ -66,25 +66,30 @@ go(function ()
     $order_info = $mod_order->getOrderInfo(['order_sn' => '4694820679086133084177']);
 
     $test = new MysqliPoolTest();
-
-    for ($i = 0; $i < 100; $i++)
+    go(function () use($test)
     {
-        Log::record("cur index = {$i}",Log::DEBUG);
-        go(function () use($test)
+        for ($i = 0; $i < 100; $i++)
         {
-            $test->setval();
-        });
-        sleep(1);
-    }
+            Log::record("cur index = {$i}",Log::DEBUG);
+            go(function () use($test)
+            {
+                $test->setval();
+            });
+            sleep(1);
+        }
+    });
 
-    for ($i = 0; $i < 100; $i++)
+    go(function () use($test)
     {
-        go(function () use($test)
+        for ($i = 0; $i < 100; $i++)
         {
-            $test->readval();
-        });
-        sleep(1);
-    }
+            go(function () use($test)
+            {
+                $test->readval();
+            });
+            sleep(1);
+        }
+    });
 
     sleep(10);
     CoRedisPool::instance()->stop();