如何输出缓冲块在PHP / Apache的工作? [英] How output buffering blocks in PHP/Apache works?

查看:162
本文介绍了如何输出缓冲块在PHP / Apache的工作?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

假如我从PHP呼应随机数据浏览器。随机的数据总量约为XGB和回声在YKB块完成。不使用ob_start()。回音必调用块之后,PHP和Apache缓冲区满(客户端不能够与它产生相同的速度消耗数据)?如果是这样,多少大小PHP和Apache缓冲区?我是否正确地理解,这个过程:

Suppose I am echoing random data from PHP to browser. Total amount of random data is about XGb and echo is done in YKb chunks. ob_start() is not used. Will echo calls block after PHP and Apache buffers are full (client is not capable of consuming data with the same speed it is generated)? If so, how much in size PHP and Apache buffers? Do I understand correctly, the process:


  • PHP回声发送字节到PHP输出缓冲区,直到填满。之后,回声开始阻塞,直到有缓冲区被发送到Apache,从而清除

  • PHP是从它的输出缓冲,直到Apache的缓冲区满发送数据。在这之后的Apache停止接收从PHP,并等待数据,直到部分缓冲器被发送到客户端和清零。

P.S。如果你被我要去实现任务的愚蠢感到惊讶,我可以说,那我书面方式小流量均衡脚本施加一定的交通规则一个dedicatied服务器(IN / OUT所占的流量比例应保持在一定值)

P.S. If you are suprised by the stupidity of the task I am going to achieve, I can say, that I am writting small traffic balancing script for a dedicatied server with certain traffic rules applied (IN/OUT traffic ratio should be kept at certain value).

推荐答案

这可关系到的 SendBufferSize 指令

This can be related to the SendBufferSize Directive.

也许这将帮助
http://fplanque.com/dev/linux/why-echo-is-slow-in-php-how-to-make-it-really-fast

这篇关于如何输出缓冲块在PHP / Apache的工作?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆