0

I have a function that includes a call to CURL. This function takes about 10 seconds to complete running, and is called to run by hitting the page that contains this function.

Now if I were to have another function that calls the function (by hitting/wget the page) above once every second, will the subsequent calls run simultaneously with the previous calls that is still doing its 10 seconds of processing and curling?

3
  • to theoretical for me i need to see something solid. Commented Sep 24, 2012 at 19:59
  • I think you should look at stackoverflow.com/a/10036599/1226894 Commented Sep 24, 2012 at 20:01
  • @Baba curl_multi is not suitable for my situation, as I want to space out the 10 curls by 1 second each and the URL curled will be retrieved from the database, which is updated every second. Commented Sep 24, 2012 at 20:06

1 Answer 1

1

If you are using Apache, this would be determined by the number of prefork processes you have ready. Your web server controls how many open HTTP connections are allowed.

Sign up to request clarification or add additional context in comments.

2 Comments

There would be a max of 9 CURLS and PHP functions running at the same time in the example above, assuming that the subsequent calls to the PHP page is not being blocked and there is no limit to the number of HTTP connections allowed. Does this mean everytime the page is called, a new process will be created and all 9 will run in parallel?
For each HTTP request, apache will delegate a prefork process to handle it until the script has finished executing. So as I said in the answer, it depends on your http config settings.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.