-
Notifications
You must be signed in to change notification settings - Fork 3.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
🪶 在 C++ 中,有提供了Socket sendfile的方法(zerocopy),可以不通过CPU去调度资源,避免重复拷贝两次DMZ(或者更多) #5330
Comments
你用的是httpserver还是tcpserver |
http基于TCP的,理论上支持 |
你是压测的过程中发现假死的吗,可以的话提供一下复现代码和压测命令 |
我只能提供文件数量和大小,压测命令我暂时没有,但可以提供数据 |
五分钟QPS:13570 |
你是用Swoole\Http\Response::end还是Swoole\Http\Response::sendfile方法发送文件 |
只有sendfile,没有end |
<?php
$http = new Swoole\Http\Server('127.0.0.1', 9501, SWOOLE_PROCESS);
$http->on('start', function ($server) {
echo "Swoole http server is started at http://127.0.0.1:9501\n";
});
$http->on('request', function ($request, $response) {
$response->header('Content-Type', 'application/octet-stream');
$response->header('Content-Disposition', 'attachment; filename=recvfile.txt');
$response->sendfile('/home/sendfile.txt');
});
$http->start(); 传输文件是100M的, 你的服务器环境是怎么样的,代码是我这样的写法吗 |
|
服务器环境:4h8g,php占用6g |
另外,是Swoole\Coroutine\Http\Server |
有内存泄漏,我看看是哪里的问题 |
我怀疑是客户端正确关闭后,没有自动释放,导致有引用计数不能为0的情况 |
因为连接数导致内存上涨和没有正确释放等问题 |
我测试了一下,这个应该不是内存泄漏,更有可能是因为php的内存管理机制会将小的内存块保留起来不还给操作系统。 |
Please answer these questions before submitting your issue.
What did you do? If possible, provide a simple script for reproducing the error.
发送文件时候会使内存升高,没有关闭的现状
What did you expect to see?
假死,内存溢出
What did you see instead?
修复正确关闭流文件或者是Socket
What version of Swoole are you using (show your
php --ri swoole
)?最新
What is your machine environment used (show your
uname -a
&php -v
&gcc -v
) ?最新
The text was updated successfully, but these errors were encountered: