I am develop script for upload/download files on server.
I am create simply php file: donload.php for download image to user and log statistics of downloading. It is very simply file but it take much server resources (memory). How i can reduce it?

Kind regards,

The skript is taking too much space or the files are taking too much space. If its the files, there may be a method to install a script for compression, but that is your only hope. If you are writing for a file server, your ONLY bet is to have your own server that you are running. Otherwise its just too expensive to do with web hosters.

how are you keeping track of the statistics?
MySQL? (on a different host? maybe to complicated a query?)

or are you physically accessing a file and updating it (does it belong to apache, you? are you accessing it via ftp?)

how often is the file typically accessed?

answer these questions and we might be able to help more

Well this is difficult to tell you the all those stuff without looking at the script. One can tell you that only after seeing the script.

My advice to you is you should php functions to track the users and put them in database