• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 298
  • Last Modified:

best way to slow a php process.

I need to be able to slow down a php batch process so that it does not take up too much system resources at certain times.

what's the best way to do this?

cris
0
CrisThompsonUK
Asked:
CrisThompsonUK
  • 2
  • 2
1 Solution
 
Julian HansenCommented:
0
 
BAKADYCommented:
with sleep(m) you can pause the process for a fixed time in milleseconds (m), but you aren't saving system resources, only the processor.

what do you mean with "at certain times"?
if other batch or program is running at the same time???
0
 
CrisThompsonUKAuthor Commented:
thanks julian.
0
 
CrisThompsonUKAuthor Commented:
We have lots of processed and things going on, and when the batch is running, we need to make sure that it doesn't use up all the system power and stop the other, user critical processes from working properly.

Some of the batch will hit the database quite hard, so pausing every 10 records of so should allow the other processes in?
0
 
Julian HansenCommented:
Yup - that will do it - CPU will stop processing but process will still consume resources (RAM) as it is still alive - if you have lots of RAM then no problem.
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

  • 2
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now