8核,tcp開(kāi)了64個(gè)進(jìn)程,壓測(cè)顯示 Throughput: 0.00
全部是采用默認(rèn)的代碼:
tcp.php
use Workerman\Worker;
require_once './workerman/Autoloader.php';
$worker = new Worker('tcp://0.0.0.0:1234');
$worker->count=64;
$worker->onMessage = function($connection, $data)
{
// 長(zhǎng)連接
$connection->send("HTTP/1.1 200 OK\r\nConnection: keep-alive\r\nServer: workerman\1.1.4\r\n\r\nhello");
// 短連接
//$connection->close("HTTP/1.1 200 OK\r\nServer: workerman\1.1.4\r\n\r\nhello");
};
Worker::runAll();
壓力測(cè)試:
./benchmark -n1 -h10000 -c1000 -p1234 127.0.0.1
輸出:
Recieved 72 bytes
Recieved 72 bytes
Recieved 72 bytes
Throughput: 0.00