I would say disable runtime restriction in PHP (e.g. use CLI script) and be patient. If you say that it starts to insert something into the database from a 17 gigabyte file, it really does a good job already. There is no reason to speed it up for such a one-time job. (Increase the memory limit, just in case. By default, 128 MB is not so much.)
source share