I'm presently managing a script that i have produced in PHP that parses and sorts out 6 different xml files close to 40mb each.

I presently run the script via a browser, along with a cron job to wget the page.

But sometimes using the server load it may block apache and and also the relaxation from the server, Wouldn't it seem sensible to transform it to PHP CLI making it purely command line? Would this improve performance? could it be well worth the time for you to do?

The script basically finds all of the data it requires, formats, sorts after which places into MySQL.

So PHP CLI or PHP Web?

Thanks ahead of time.

Shadi

PHP CLI.

It can make no sense to connect apache's assets with this.

Nevertheless, it's no guarantee that the script won't slow your server lower, since that is dependent around the actual script that's being performed.

Parsing a couple of such xml files and storing their contents, shouldn't pose a problem on modern hardware. Even when the script is not highly optimized.

Try to load very little data at the same time, and correctly cleanup used assets after use, to lessen memory consumption. Use extensions for xml-parsing to lessen load.

Yes. Particularly if you use SAX or even the PHP pull-parser to see the XML, to ensure that you aren't loading the whole file in memory. It might also not connect apache's assets.