限制lighttpd上测试的上传速度

发布于 2024-07-22 18:32:31 字数 329 浏览 4 评论 0原文

我正在实施 ubr 上传。 它使用 Perl 和 PHP 来上传带有进度条的文件。 我正在运行 lighttpd 开发服务器并想对其进行全面测试。 目前它只是立即传输文件,因为它实际上只是在我的计算机上移动文件。 有没有办法让它看起来像实际缓慢传输,以便我可以观看进度条?

我尝试将以下内容添加到我的lighttpd.conf 中。 它可能会稍微减慢加载页面的速度,但上传仍然是即时的。

$HTTP["host"] == "localhost" {
        server.kbytes-per-second = 8
}

谢谢

I'm implementing ubr upload. It used Perl and PHP to upload files with a progress bar. I'm running a lighttpd development server and would like to test it fully. Currently it just transfer the files instantly since its really just moving files on my computer. Is there a way to make it seem like it actually transfers it slowly so I can watch the progress bar?

I tried adding the following to my lighttpd.conf. It may have slowed down loading the pages a little, but uploads are still instantanteous.

$HTTP["host"] == "localhost" {
        server.kbytes-per-second = 8
}

Thanks

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(6

与酒说心事 2024-07-29 18:32:31

您可以尝试限制客户端计算机,而不是限制服务器端的事物。 O'Reilly 有一篇关于如何限制 Mac 带宽的好文章:

ipfw 是 BSD 的事情,但在 Linux 上你可以尝试使用 shaper 模块和 shapecfg

Instead of throttling things on the server side, you could try throttling your client machine. There's a nice article on how to throttle bandwidth on macs over at O'Reilly:

ipfw is a BSD thing, but on Linux you could try using the shaper module and shapecfg:

泪眸﹌ 2024-07-29 18:32:31

$HTTP['host'] 包含服务器的主机。 您可以将配置变量放入配置文件中,而无需进行主机检查。

$HTTP['host'] contains the host of the server. You could put the config variable in the configuration file without the host check.

﹎☆浅夏丿初晴 2024-07-29 18:32:31

谢谢您的帮助! 实际上,我是双启动的,只是在我的 apache 服务器上测试了我的确切脚本。 当我在 apache 上传输 200mb 文件时,它实际上会在文件传输时显示进度条。 在我的 lighttpd 服务器上,页面“繁忙”,因为它在后台发布文件,然后弹出栏显示 100% 完成。

我认为该脚本的工作方式是 CGI 发布文件,并且在执行此操作时,它会不断将已写入的大小写入另一个文件中。 然后每秒都会调用一个 php 脚本来打开该文件并查看已写入的内容。

看来我的 lighttpd 服务器不允许 perl 和 php 同时工作..不过我可能是错的。

在我的 Windows 服务器上,我实际上安装了 WAMP 和 perl。 我的 lighttpd 对 php 使用 fastcgi,对 perl 脚本使用 mod_cgi 模块。

Thanks for the help! Actually, I'm dual booting and just tested my exact script on my apache server. When I transfer a 200mb file on apache it actually displays the progress bar as the file transfers. On my lighttpd server, the page is "busy" as it posts the file in the background, then the bar pops up as 100% complete.

I think the way the script works is that CGI posts the file, and as it is doing that it keeps writing the size it has written into another file. Then a php script is being called every second which opens this file and looks at how much has been written.

It seems like my lighttpd server is not allowing perl and php to work at the same time.. I may be wrong though.

On my windows server I actually installed WAMP and perl. My lighttpd is using fastcgi for the php and just mod_cgi module for the perl scripts.

篱下浅笙歌 2024-07-29 18:32:31

啊,看起来其他人对 lighttpd 和 uber 上传器有问题...

(因为我是新人,所以无法链接到它)

现在的问题是 lighttpd 是否值得使用,因为我必须首先更改此设置我的 mod_rewrite 东西。

Ah it looks like other people have issues with lighttpd and uber uploader...

(can't link to it since I'm new)

Now the question is if lighttpd is worth using since I'll have to change this on top of all my mod_rewrite stuff.

情深已缘浅 2024-07-29 18:32:31

您可以使用 Sloppy HTTP 代理来限制浏览器带宽:http://www.dallaway.com/sloppy/

马虎故意减慢客户端和服务器之间的数据传输速度。

示例用法:您可能在本地网络上构建网站,速度很快。 使用 Sloppy 是获得工作“拨号体验”的一种方法,无需安装调制解调器。

You can limit your browser bandwidth by using the Sloppy HTTP proxy: http://www.dallaway.com/sloppy/

Sloppy deliberately slows the transfer of data between client and server.

Example usage: you probably build web sites on your local network, which is fast. Using Sloppy is one way to get the "dial-up experience" of your work without the hassle of having to install a modem.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文