Re: [PHP] how to check for bandwidth limitations when uploading files?

2010-05-05 Thread Jochen Schultz

OS?

Robert P. J. Day schrieb:
  probably not really a PHP question but i'll take a chance, anyway.  i 
want to examine the network throughput i can get when continually 
uploading files from a PHP script via a POST request using the 
HTTP_Request2 class.


  i have a client-side script that simply takes files, creates a short 
POST request, and submits it to a server-side PHP script that takes the 
uploaded file and saves it.  no big deal.


  as a test, i created a random 5M file, then looped 100 times 
submitting the same file, and timed it.  while the system and user time 
was only a few seconds total, real (clock on the wall) time was 2.5 
minutes.  this suggests that the bottleneck is simply network transfer 
speed.


  while i'm doing these uploads, is there a way to monitor network 
throughput?  if this is truly the bottleneck, the only real solution 
will be to pay a premium for faster network access, i suppose.  but i'd 
just like to be able to produce some numbers or evidence that that's the 
actual problem.  thoughts?


rday




--
 Sport Import GmbH   - Amtsgericht Oldenburg  - Tel:   +49-4405-9280-63
 Industriestrasse 39 - HRB 1202900-
 26188 Edewecht  - GF: Michael Müllmann

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



RE: [PHP] how to check for bandwidth limitations when uploading files?

2010-05-05 Thread Tommy Pham
 -Original Message-
 From: Robert P. J. Day [mailto:rpj...@crashcourse.ca]
 Sent: Wednesday, May 05, 2010 3:52 AM
 To: php-general@lists.php.net
 Subject: [PHP] how to check for bandwidth limitations when uploading
files?
 
probably not really a PHP question but i'll take a chance, anyway.
 i want to examine the network throughput i can get when continually
 uploading files from a PHP script via a POST request using the
 HTTP_Request2 class.
 
i have a client-side script that simply takes files, creates a short
POST
 request, and submits it to a server-side PHP script that takes the
uploaded
 file and saves it.  no big deal.
 
as a test, i created a random 5M file, then looped 100 times submitting
the
 same file, and timed it.  while the system and user time was only a few
 seconds total, real (clock on the wall) time was
 2.5 minutes.  this suggests that the bottleneck is simply network transfer
 speed.
 
while i'm doing these uploads, is there a way to monitor network
 throughput?  if this is truly the bottleneck, the only real solution will
be to pay
 a premium for faster network access, i suppose.  but i'd just like to be
able to
 produce some numbers or evidence that that's the actual problem.
 thoughts?
 
 rday
 

IIRC, if you're on *BSD and have PF running, you can get the bandwidth of
each individual connection via pftop (?).  On Windows, there are several
tools that will give similar results.  Don't know about Linux.  OTOH, maybe
your script isn't timed correctly?  Is the tested loop done on the localhost
or from another remote host establishing the connection via the internet?
FYI, if you're hosting it yourself and have async connection like DSL or
cable, the upload to your server is the download connection speed which
should be faster than your upload (from the server) to the clients.  And a
5MB file shouldn't take long provided that your server hasn't reached its
resources limits and the internet pipe isn't consumed by other services or
systems on the LAN.

Regards,
Tommy


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] how to check for bandwidth limitations when uploading files?

2010-05-05 Thread Robert P. J. Day

Quoting Jochen Schultz jschu...@sportimport.de:


OS?

Robert P. J. Day schrieb:
 probably not really a PHP question but i'll take a chance, anyway.  
  i want to examine the network throughput i can get when   
continually uploading files from a PHP script via a POST request   
using the HTTP_Request2 class.


 i have a client-side script that simply takes files, creates a   
short POST request, and submits it to a server-side PHP script that  
 takes the uploaded file and saves it.  no big deal.


 as a test, i created a random 5M file, then looped 100 times   
submitting the same file, and timed it.  while the system and user   
time was only a few seconds total, real (clock on the wall) time   
was 2.5 minutes.  this suggests that the bottleneck is simply   
network transfer speed.


 while i'm doing these uploads, is there a way to monitor network   
throughput?  if this is truly the bottleneck, the only real   
solution will be to pay a premium for faster network access, i   
suppose.  but i'd just like to be able to produce some numbers or   
evidence that that's the actual problem.  thoughts?


  whoops, sorry, CentOS 5.4.

rday


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] how to check for bandwidth limitations when uploading files?

2010-05-05 Thread tedd

At 6:52 AM -0400 5/5/10, Robert P. J. Day wrote:
  probably not really a PHP question but i'll take a chance, anyway.  
i want to examine the network throughput i can get when continually 
uploading files from a PHP script via a POST request using the 
HTTP_Request2 class.


  i have a client-side script that simply takes files, creates a 
short POST request, and submits it to a server-side PHP script that 
takes the uploaded file and saves it.  no big deal.


  as a test, i created a random 5M file, then looped 100 times 
submitting the same file, and timed it.  while the system and user 
time was only a few seconds total, real (clock on the wall) time was 
2.5 minutes.  this suggests that the bottleneck is simply network 
transfer speed.


  while i'm doing these uploads, is there a way to monitor network 
throughput?  if this is truly the bottleneck, the only real solution 
will be to pay a premium for faster network access, i suppose.  but 
i'd just like to be able to produce some numbers or evidence that 
that's the actual problem.  thoughts?


rday


You might want to test your connection, such as:

http://www.speakeasy.net/speedtest/

Cheers,

tedd


--
---
http://sperling.com  http://ancientstones.com  http://earthstones.com

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] how to check for bandwidth limitations when uploading files?

2010-05-05 Thread Jim Lucas
Robert P. J. Day wrote:
   probably not really a PHP question but i'll take a chance, anyway.  i
 want to examine the network throughput i can get when continually
 uploading files from a PHP script via a POST request using the
 HTTP_Request2 class.
 
   i have a client-side script that simply takes files, creates a short
 POST request, and submits it to a server-side PHP script that takes the
 uploaded file and saves it.  no big deal.
 
   as a test, i created a random 5M file, then looped 100 times
 submitting the same file, and timed it.  while the system and user time
 was only a few seconds total, real (clock on the wall) time was 2.5
 minutes.  this suggests that the bottleneck is simply network transfer
 speed.
 
   while i'm doing these uploads, is there a way to monitor network
 throughput?  if this is truly the bottleneck, the only real solution
 will be to pay a premium for faster network access, i suppose.  but i'd
 just like to be able to produce some numbers or evidence that that's the
 actual problem.  thoughts?
 
 rday
 
 

What web server are you using?  Is it Apache, lighttpd, php daemon, etc?

If it is anything but directly talking to a php daemon, you must take into
consideration that the parent web server does not hand off processing to PHP
until it has received the entire file.  At this point is when your timer script
starts working.

So, what is receiving the file?

-- 
Jim Lucas

   Some men are born to greatness, some achieve greatness,
   and some have greatness thrust upon them.

Twelfth Night, Act II, Scene V
by William Shakespeare

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] how to check for bandwidth limitations when uploading files?

2010-05-05 Thread Nathan Rixham

Jim Lucas wrote:

Robert P. J. Day wrote:

  probably not really a PHP question but i'll take a chance, anyway.  i
want to examine the network throughput i can get when continually
uploading files from a PHP script via a POST request using the
HTTP_Request2 class.

  i have a client-side script that simply takes files, creates a short
POST request, and submits it to a server-side PHP script that takes the
uploaded file and saves it.  no big deal.

  as a test, i created a random 5M file, then looped 100 times
submitting the same file, and timed it.  while the system and user time
was only a few seconds total, real (clock on the wall) time was 2.5
minutes.  this suggests that the bottleneck is simply network transfer
speed.

  while i'm doing these uploads, is there a way to monitor network
throughput?  if this is truly the bottleneck, the only real solution
will be to pay a premium for faster network access, i suppose.  but i'd
just like to be able to produce some numbers or evidence that that's the
actual problem.  thoughts?

rday




What web server are you using?  Is it Apache, lighttpd, php daemon, etc?

If it is anything but directly talking to a php daemon, you must take into
consideration that the parent web server does not hand off processing to PHP
until it has received the entire file.  At this point is when your timer script
starts working.

So, what is receiving the file?



I'd call the script via ab [1] from localhost, the computer you're 
testing and then another server with a good connection - that way you'll 
get solid numbers and be able to pinpoint the bottleneck in a snap.


[1] http://httpd.apache.org/docs/2.0/programs/ab.html

Best,

Nathan

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php