电子商务门户的数据库更新需要花时间使用php cron脚本

I am trying to update the database of an e commerce website with a php cron script in linux server.The cron is update products in a table where the number of products are around 1200000.The problem is cron is taking almost one day to complete the cron sript,which is very much.

Please tell me the points on how can i reduce the cron script updation time to 2-3 hours or less than that.

Database- Mysql Language-Php Server-Linux

  1. Use multiple processes that will each treat a subset of products. You can do that with pnctl or just launch your script multiple times passing parameter to tell where to start for example.

  2. If you are doing inserts, you can do mass insert instead of 1 insert per sql query.

  3. See if anything can be optimized in your algorithm (e.g. by using caching or reducing its complexity). However, i guess you already tried that.