duanhe2027 2011-02-08 13:04
浏览 22
已采纳

维护脚本使加载变慢

I run a script on a website each time the user will visit the homepage. The script will go through each rows in the database and check of its date has expired and archive it if true. However, since it has many rows, it does take some time (like 6 seconds) while loading the homepage.

Firstly, i suggested to use a cronjob for the task, but my boss suggested this idea, but i digress...

My question is, is it possible to run the script in parallel, so that, the homepage can continue on to load while the script is also running. Also note that the homepage displays data from the database, so it is quite important that the execution of the script ends before the homepage finishes loading

  • 写回答

2条回答 默认 最新

  • dpfwhb7470 2011-02-08 13:13
    关注

    if you need to run a maintenance script everytime you get a visitor, you site is very broken, and a better idea would be to fix the system so it doesnt need maintaining every second

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(1条)

报告相同问题?

悬赏问题

  • ¥15 HFSS 中的 H 场图与 MATLAB 中绘制的 B1 场 部分对应不上
  • ¥15 如何在scanpy上做差异基因和通路富集?
  • ¥20 关于#硬件工程#的问题,请各位专家解答!
  • ¥15 关于#matlab#的问题:期望的系统闭环传递函数为G(s)=wn^2/s^2+2¢wn+wn^2阻尼系数¢=0.707,使系统具有较小的超调量
  • ¥15 FLUENT如何实现在堆积颗粒的上表面加载高斯热源
  • ¥30 截图中的mathematics程序转换成matlab
  • ¥15 动力学代码报错,维度不匹配
  • ¥15 Power query添加列问题
  • ¥50 Kubernetes&Fission&Eleasticsearch
  • ¥15 報錯:Person is not mapped,如何解決?