views:

134

answers:

3

I have two test computers networked together.

One has a gigabit ethernet, the other a 10 megabit.

Theoretically, data trasferred between the two should reach about 1megabytes p/s.

Now im using a PHP script to read data from one host to another using fread. Both reading file and file to be read are chmod 777.

Both computers are running wampserver and both have zonealarm and avast installed and running. Zonealarm is configured to recognise both computers as trusted parts of the network.

Using the time() function to work out the time it takes for the script to read a file on the other comp. The file im reading is 10megabytes. It should take just over 10 seconds. Yet it takes around 30 seconds. Average 300kbs.

So where is the bottleneck in my setup?

One comp is vista, otehr is xp if that matters.

+2  A: 

While there's a lot of guesses we can take, this probably belongs on serverfault as you are not asking programming wise what the issue is, and honestly, even there, this will take a lot of trial and error. Not really suitable for question/answer.

altCognito
A: 

Open up the task manager (ctrl+alt+delete, task manager), then switch to the second tab (or the third?) and watch the CPU and network usage as you run the test. If the CPU usage is at 100%, that may be the bottleneck. Check the network usage too to see if there is any overhead you don't expect.

That's where I'd start.

David Wolever
i have checked. both cpus at most reach 10-20% and niether are connected to the internet or have any other network programs running.
ctrl+shift+esc is also the task manager
Copas
+3  A: 

Just because your network speed is 10Mb/sec doesn't mean that the application layer gets that. There is TCP/IP header information (~64 bytes per 1500 byte packet), time processing the buffers in the kernel, time spent doing buffer transfers to/from the LAN controller chip, etc.

I assume when you said you're getting 300kbs you really mean 3mbs, right?

Twelvestring
no. i actually mean 300kilobytes when i should be getting around 1-2 megabytes
Theoretical peak would be 1.25 megabytes per second.300 kilobytes per second represents 25% of that theoretical peak, which isn't too shabby, especially considering all the factors twelvestring outlined.
Frank Farmer
300KBs is roughly 3Mbs.There is some confusion about communications. A small b indicates bits; a upper-case B represents bytes. Easily confused.
Twelvestring