file - How does PHP copy() handle memory -


i need use php's copy() function copy files 1 location another. intentionally not using rename().

the files 500mb 1gb. seems takes 10-20 seconds move them after start php script (one file handled per execution).

my server rejecting upload of these files because of max_execution_time, post_max_size, upload_max_filesize , memory_limit values, of set ridiculously high, server time out when trying upload.

now i'm concerned server fail if copy() operation running while site dealing lot of traffic.

so question is, php's copy() operate in way overload server's memory and/or execution time limits?

i know php script takes lot of time complete, hope time period of low-memory "waiting time" php sits , lets server os move file... wouldn't think php need load file buffer or in order copy it, memory discussion on level topic bit out of understanding.

can explain how php copy() uses memory, , if there risks associated memory overloads?

looking @ the source copy, it works ultimately reading , writing chunks of 8kb size -- won't end allocating whole lot of server's memory. of course 1 expect happen, people have commented.

however, multiple copies of big files running in parallel can kill performance of storage medium (especially if it's made of spinning rust), in turn can lead copies taking ridiculous amounts of time complete. turn out longer script's max execution time limit, idea remove limit before starting copy.


Comments

Popular posts from this blog

Unable to remove the www from url on https using .htaccess -