Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

problem of time delay when using 'copy' With Large Files

Status
Not open for further replies.

Svyatoslav777

Programmer
Oct 20, 2010
2
Hello
I got a problem of a big time delay while copying a large file onto my web server via php script. I mean the process appears to run very slowly, about minute or even two.

Here is the code:
---------------------
<?PHP
if (copy('file1', 'file2'))
{ echo "ALL ITS OK"; }
else
{ echo "Error!!!"; }
-------------------------
My system config is:
file1 has size 700mb
?>
------------------------
Can anybody please tell me what could be the reason for such a big time delay while completing such a simple function as copy()?

Thanks in advance!)
 
that's quite probably how long it takes to copy a file from one location to another.

 
Suppose not, for example, different file hosting servers make this immediately however big file there is, within settled size limits, of course.
 
i think that is vanishingly unlikely.

the speed of a file copy operation is governed by the size of the file, the speed of the disk drive and the amount of real and virtual memory being consumed at that time.
 
I have to agree with jpadie, copying a 700MB file form one location to the next is bound to take some time. 700MB is not a small file.


Judging by the fact you are using a Windows XP HOME machine I'd say the Pc is not very powerful. 2 minutes on a 700MB file seems about right.



----------------------------------
Phil AKA Vacunita
----------------------------------
Ignorance is not necessarily Bliss, case in point:
Unknown has caused an Unknown Error on Unknown and must be shutdown to prevent damage to Unknown.

Behind the Web, Tips and Tricks for Web Development.
 
700 / 60 = 11.66 megabytes / second
700 / 120 = 5.83 megabytes / second

Running PHP on XP I'd guess has lower performance than running PHP/Apache i debian, ubuntu, fedora, etc.

When I'm in Windows 7, on my client-PC (i5 760@4.3Ghz), some "ok" harddrives, I can usually get about 40 +- mb/s when copying from harddrive to harddrive. Some of my drives are faster than the others, like the OS I run on raid-0 wd raptors (the 74gb version).

If there is an annoyance waiting for files, I'd consider making this function "ajax".

There are several PHP/Ajax file managers out there (even free ones). If you just need the copy however, you can just code it your self.. Just find some sample "ajax tutorial" and modify it to your needs.

Olav Alexander Mjelde
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top