Solved

best way to slow a php process.

Posted on 2013-06-13
5
290 Views
Last Modified: 2013-06-13
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
Comment
Question by:CrisThompsonUK
  • 2
  • 2
5 Comments
 
LVL 51

Accepted Solution

by:
Julian Hansen earned 500 total points
Comment Utility
0
 
LVL 4

Expert Comment

by:BAKADY
Comment Utility
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
 

Author Closing Comment

by:CrisThompsonUK
Comment Utility
thanks julian.
0
 

Author Comment

by:CrisThompsonUK
Comment Utility
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
 
LVL 51

Expert Comment

by:Julian Hansen
Comment Utility
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

What Should I Do With This Threat Intelligence?

Are you wondering if you actually need threat intelligence? The answer is yes. We explain the basics for creating useful threat intelligence.

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
Mysqli Query 5 40
PHP and Soap 3 25
creating 2 user ID's 5 24
slider is moved too far too the right...how to move back left? 4 10
Consider the following scenario: You are working on a website and make something great - something that lets the server work with information submitted by your users. This could be anything, from a simple guestbook to a e-Money solution. But what…
Both Easy and Powerful How easy is PHP? http://lmgtfy.com?q=how+easy+is+php (http://lmgtfy.com?q=how+easy+is+php)  Very easy.  It has been described as "a programming language even my grandmother can use." How powerful is PHP?  http://en.wikiped…
The viewer will learn how to count occurrences of each item in an array.
The viewer will learn how to create a basic form using some HTML5 and PHP for later processing. Set up your basic HTML file. Open your form tag and set the method and action attributes.: (CODE) Set up your first few inputs one for the name and …

728 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now