Global Bandwidth Limits problem

 
Post new topic   Reply to topic    Aprelium Forum Index -> General Questions
View previous topic :: View next topic  
Author Message
bean
-


Joined: 10 Feb 2005
Posts: 20

PostPosted: Wed Sep 19, 2007 8:37 pm    Post subject: Global Bandwidth Limits problem Reply with quote

I can't get this PHP script to work like I want it to. http://www.hotscripts.com/Detailed/64866.html .

I can't seem to find the problem. Is it the script or the "Bandwidth Limits" that's gives me the problems? It only gives problems when the Global Bandwidth Limits are set. The problem is that the download speed gets very very unstable. Sometimes it even stop the download.

I use Abyss Web Server X2 v2.3.0.5. Have MySQL and PHP4.0 installed. Even tryed PHP4.3 as I thought it might be a PHP problem. I also tryed X1 2.5 without any luck. Could someone try to install the script and see if Im the only one that have this problem? The script is a directory sniffer so you just upload some files to a directory and the PHP script will show what you have uploaded.

When you run the script for the first time all seem to work. Then try to stop the download - refresh the page and try to download again. That's where the problem starts.

I hope someone can help me out.
Back to top View user's profile Send private message
TRUSTAbyss
-


Joined: 29 Oct 2003
Posts: 3752
Location: USA, GA

PostPosted: Wed Sep 19, 2007 9:03 pm    Post subject: Reply with quote

Edit: Read Admin's reply.
Bandwidth Throttling doesn't work for PHP scripts since Abyss sends the script to the Interpreter (PHP Processor).


Last edited by TRUSTAbyss on Thu Sep 20, 2007 11:32 pm; edited 2 times in total
Back to top View user's profile Send private message Visit poster's website
bean
-


Joined: 10 Feb 2005
Posts: 20

PostPosted: Wed Sep 19, 2007 9:14 pm    Post subject: Reply with quote

Crap.

Thanks for the reply!
Back to top View user's profile Send private message
admin
Site Admin


Joined: 03 Mar 2002
Posts: 1295

PostPosted: Thu Sep 20, 2007 12:49 am    Post subject: Reply with quote

TRUSTAbyss wrote:
Bandwidth Throttling doesn't work for PHP scripts since Abyss sends the script to the Interpreter (PHP Processor).


No. It works for any type of data (even dynamically generated pages). It's not just for static pages.

Bandwidth throttling has an effect on the overall output sent by the server to the clients regardless of its origin (SSI, script, HTML page, image, or error page).

Bean,

Have you increased the PHP processing time (it is by default set to 30 seconds in php.ini which could be a bit short for a long download).
_________________
Follow @abyssws on Twitter
Subscribe to our newsletter
_________________
Forum Administrator
Aprelium - https://aprelium.com
Back to top View user's profile Send private message
pkSML
-


Joined: 29 May 2006
Posts: 952
Location: Michigan, USA

PostPosted: Thu Sep 20, 2007 2:08 am    Post subject: Reply with quote

Yes, I've dealt with the same issue. I had a script that served an MP3 file in real time. It was a bandwidth throttle script, so a user couldn't just download it in a breeze.

Anyways, after thirty seconds, the script just stopped. It turned out to be the timeout value for CGI scripts.
For PHP scripts, just add this (thanks to Andy @ Abyssunderground):
Code:
// Tells PHP to time out after the set time limit in seconds, rather than the default set in php.ini
// This option may not work on a server with safe_mode enabled
set_time_limit(120);

_________________
Stephen
Need a LitlURL?


http://CodeBin.yi.org
Back to top View user's profile Send private message Visit poster's website
bean
-


Joined: 10 Feb 2005
Posts: 20

PostPosted: Thu Sep 20, 2007 6:40 am    Post subject: Reply with quote

It works when I download a file for the first time. The PHP.ini is set to big filesizes. So I can download the first file without any problems.
But - if I stop the download - refresh the page and try to download it again the problem starts. All this I can do within 3 seconds. And it only happens when bandwidth throttling is enabeled.
Anyone tryed the script yet?
Back to top View user's profile Send private message
aprelium
-


Joined: 22 Mar 2002
Posts: 6800

PostPosted: Thu Sep 20, 2007 12:32 pm    Post subject: Reply with quote

bean,

We tested the script and here is the explanation of what is happenning:

Say you have a 2000 KB file and that you set global bandwidth throttling to 10 KB/s.

You click the file in the script page, the download starts, its speed is limited to 10 KB/s (we assume no one else is using your server at the same time).

Now you stop the download in your browser. The connection is closed on the browser side but the server needs some time (from a few seconds to 10 more seconds in some cases) to get notified about that.

During these seconds, the server continues to send data from its end to the client (and consumes bandwidth). That's why your second download seems so slow.

You'll have to wait for a while until the server notices that the connection was closed, and stop sending data (the already sent data will be lost). After that everything will work fine.
_________________
Support Team
Aprelium - http://www.aprelium.com
Back to top View user's profile Send private message Send e-mail
bean
-


Joined: 10 Feb 2005
Posts: 20

PostPosted: Thu Sep 20, 2007 3:40 pm    Post subject: Reply with quote

Thanks, aprelium! Im no PHP guru but I see what you are saying. The PHP.ini I had was set to 1800 seconds. Setting it to 60 I can also download with max bandwidth throttle again after a 1 minut waiting time.
Thanks again - problem solved.
Back to top View user's profile Send private message
loloyd
-


Joined: 03 Mar 2006
Posts: 435
Location: Philippines

PostPosted: Fri Sep 21, 2007 4:16 am    Post subject: Reply with quote

Thank you for the information on this, Aprelium and bean. Now I can better appreciate the timeouts from within PHP.ini and from Abyss's Scripting Parameters settings.
_________________

http://home.loloyd.com/ is online if the logo graphic at left is showing.
Back to top View user's profile Send private message Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic    Aprelium Forum Index -> General Questions All times are GMT + 1 Hour
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB phpBB Group