proophsoftware / swoole-mongo-test

Test MongoDB with Swoole
MIT License
2 stars 0 forks source link

swoole-test

Test Swoole Coroutine feature

Set up

$ composer install
$ docker-compose up -d

How it works

Swoole Http Server runs with one worker only.

If you hit the server with '/?reg_num=' it will perform a query that sleeps for 10 seconds. This emulates a very slow query.

Mongo DB

One Swoole server listens on port 8080. It uses mongoDB to perform the slow query. Hitting the server with:

PDO MySQL

Second Swoole server listens on port 8081. It uses PDO to perform the slow query. There are two db backends available: Postgres and MySql In the server-pdo.php file you can set $useMySql = false; to let the server use Postgres instead of MySql.

Hitting the server with: