• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 301
  • 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
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Cloud Class® Course: Python 3 Fundamentals

This course will teach participants about installing and configuring Python, syntax, importing, statements, types, strings, booleans, files, lists, tuples, comprehensions, functions, and classes.

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