Home  >  Article  >  Backend Development  >  分时间段处置策略

分时间段处置策略

WBOY
WBOYOriginal
2016-06-13 11:17:49861browse

分时间段处理策略?
有一万条数据.
每个小时只能处理一千条. 

这个分时间段和分批的策略该如何做呢??

不考虑人工分批和分时间段.

我打算用计划任务, 再把所有数据分批, 一个时间点处理一批.
不知道这个方法可行否.

还有其他更好的策略吗?求高人指点.


------解决方案--------------------
分时间段这个可以用shell做个定时执行任务,分批处理可以采用类似php分页处理数据的方法,比如每次取100条。先将分批处理的情况写成一个方法,然后用shell在指定的时间点去调用这个方法就行了。
Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn