dongsha2792 2015-03-03 16:49
浏览 65

电子商务门户的数据库更新需要花时间使用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条回答 默认 最新

  • dongzhou8764 2015-03-03 17:05
    关注
    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.

    评论

报告相同问题?

悬赏问题

  • ¥15 uniapp uview http 如何实现统一的请求异常信息提示?
  • ¥15 目详情-五一模拟赛详情页
  • ¥15 有了解d3和topogram.js库的吗?有偿请教
  • ¥100 任意维数的K均值聚类
  • ¥15 stamps做sbas-insar,时序沉降图怎么画
  • ¥15 买了个传感器,根据商家发的代码和步骤使用但是代码报错了不会改,有没有人可以看看
  • ¥15 关于#Java#的问题,如何解决?
  • ¥15 加热介质是液体,换热器壳侧导热系数和总的导热系数怎么算
  • ¥100 嵌入式系统基于PIC16F882和热敏电阻的数字温度计
  • ¥15 cmd cl 0x000007b