Script loses performance over server as time passes?
It depends on the code. Most programmers I know think that Garbage Collector solves any problem with memory and ends up causing leaks (this is independent of the platform, and is as relevant in PHP as any other).
Because even closing the tab, the script keeps running?
PHP is a server side technology. The client (almost always a browser) makes requests, and the server (Apache/Tomcat/IIS) processes and responds. The answer will be prepared and sent to the address and door of the client even if the client program is closed.
I can somehow abort script execution and relaunch it?
Yes. The ideal, however, is to perform the long task in parts. For example, treating fifty-five thousand images is a bit heavy, but you can treat it every twenty (or maybe even less) and send a response to each pack of images to the customer. So you:
- Ensures that in case of error, you can resume the task of the package you stopped in;
- Transforms the certainty of a timeout into a mere possibility, which can be avoided if the answers are constant;
And most importantly:
- You can thus wipe all the memory consumed by the process to each package, which makes it even easier the task of building a scalable system.