publish extension
| From: | xinhua guo | Date: | Fri, 19 Dec 2014 09:55:32 +0000 |
| Subject: | publish extension | ||
| Groups: | php.pecl.dev | ||
| Request: | Send a blank email to pecl-dev+get-12480@lists.php.net to get a copy of this message | ||
1.*About myself*
Hello , I am Gary live in china ,my Chinese name is xinhua.guo , i am a
phper , two years ago i am work on sina, now i work for jumei.com ,and i
love php very much.
2. *About the extension*
Start a proxy process and the process hold some tcp. Provide local
connection pool like java
Require:
- PHP 5.3 +(no zts , zts support in todo list)
- linux 2.6+
- pdo and redis extension installed
Technical characteristics:
- After each time fetchAll (set/get) call release() method, release the
connection to the pool, avoid that the script jammed causing
connection occupy
high problem.
- The maximum and minimum number of connections configuration support.
- Support small pressure automatic recovery connection.
- Support graceful restart (reload).
- Do a lot of optimization, although the request through the connection
pool process forward, but no loss of QPS.
- When the connection use out,support queue.
- Simple! just change the new method and add release function (see
demon),you used the tcp pool.
Use it!
step 1 move the pool.ini file to /etc/ and modify it as you need.
step 2 start the pool_server process: ./pool_server start support
"start" "stop" "restart" "reload"
step 3 modify you php script:
<?php
$db = new PDO(xxxxx);
=> $db = new pdo_connect_pool(xxxx);//dont use persistent
$redis = new Redis();
=》$redis = new redis_connect_pool();//dont use pconnect
tips:use $db/$redis->release() to release the connection as early as you can;
?>
3.The code on github
https://github.com/swoole/php-connect-pool