简体   繁体   English

PHP cURL上传速度

[英]PHP cURL upload speed

I made a script that uploads files to different servers using PHP cURL and the problem is that it eats all my upload bandwidth and my Apache server does not respond as I would like. 我编写了一个脚本,该脚本使用PHP cURL将文件上传到其他服务器,问题是它占用了我所有的上传带宽,而我的Apache服务器没有响应。

The call is made from the PHP-CLI and can not use any Apache bandwidth, limiting bandwidth. 该调用是通过PHP-CLI进行的 ,不能使用任何Apache带宽,从而限制了带宽。

Could you be a bit more specific? 您能更具体一点吗? You could for example show us the code. 例如,您可以向我们展示代码。

You could also log the bandwith you have been using and put constraints in your code. 您还可以记录您一直在使用的band并在代码中放置约束。

Have you tried the CURLOPT_READFUNCTION option? 您是否尝试过CURLOPT_READFUNCTION选项? Creating your own function for reading the data will allow you also to throttle the bandwidth. 创建自己的读取数据的功能还可以限制带宽。

Apache doesn't have any bandwidth limits. Apache没有任何带宽限制。 It's your network's bandwidth limit. 这是您网络的带宽限制。 Consider not to spam other sites , and your Apache server would always respond quickly. 考虑不要向其他站点发送垃圾邮件 ,并且您的Apache服务器将始终快速响应。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM