Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8569763
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T18:24:45+00:00 2026-06-11T18:24:45+00:00

As the title states: what is the number of asynchronous request that can be

  • 0

As the title states: what is the number of asynchronous request that can be made to a PHP script that makes CURL requests and returns some information, or approximate number if hardware dependent.

For example:

A piece of Javascript runs in a loop 50 times making asynchronous get requests via AJAX to the same PHP script, storing the result in an array as they are returned.

How many such requests could reasonably made or can the server only think about one CURL request at a time?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-11T18:24:47+00:00Added an answer on June 11, 2026 at 6:24 pm

    What you’re looking for are the curl_multi_* functions. An example would be like this:

    //create the multiple cURL handle
    $mh = curl_multi_init();
    
    // Loop over pages and get set the URL to the cURL queue
    foreach ($urls as $url) {
    
        // Get a cURL handle of the current URL
        $ch = curl_init();
        curl_setopt($ch, CURLOPT_URL, $url);
        // Set all your other curl_setopt() options here for the transfers
    
    
        // Success
        if (gettype($ch) == 'resource' && get_resource_type($ch) == 'curl') {
            curl_multi_add_handle($mh, $ch);
        }
    }
    
    // Execute the handles
    do {
        $mrc = curl_multi_exec($mh, $active);
    } while ($mrc == CURLM_CALL_MULTI_PERFORM);
    
    while ($active && $mrc == CURLM_OK) {
        if (curl_multi_select($mh) != -1) {
            do {
                $mrc = curl_multi_exec($mh, $active);
            } while ($mrc == CURLM_CALL_MULTI_PERFORM);
        }
    }
    

    I am using that on one of my sites to download around 50 URLs and it works perfectly. Of course, it all depends on the allocated memory for your script. You can also set a timeout so that no URLs can make your script hang for too long.

    Edit: To actually answer your question, I’m not sure what the limit of the number of URLs you can input into this function is. I would believe that it varies from server to server depending on connection speed, and memory and possibly CPU if you’re doing something processor intensive with the result. But with that said, if all of the requests are being made to the same remote server, you may run into bottleneck issues depending on its configuration. This is independent of whether you are using PHP multiple cURL requests or AJAX. All web servers are made to handle many concurrent requests even to the same script, but you can still run into issues with any of the following situations:

    • Each of the requests sent are very resource consuming
    • The remote server needs to lock the database, in which case all requests will be executed one by one, so there would be very little difference in sending them all at once or one at a time.
    • The remote server uses file-based sessions in PHP and your requests require sessions
    • The remote server is set up to allow very few maximum concurrent clients (generally Nginx handles many concurrent clients better than Apache since it doesn’t need to fork a new process for every request, so if it becomes an issue you might want to look into switching web servers). In this case, all subsequent requests will be queued up to a certain hard limit amount and above that, they will be dropped.
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

As the title states, I am using devise. I came upon this link that
I have some regular expression code that grabs the data between the title tags
As the title states, if I don't clean my project before building, neither the
As the title states, I'm trying to resize a Texture2D before even considering SpriteBatch.Draw()
As the title states, how expensive are Python dictionaries to handle? Creation, insertion, updating,
As the title states my Ajax call is actually causing the form to be
As the title states, I need to relace all occurrences of the $ sign
As the title states: what (if available) is the replacement for the <typeConfig />
As the title states, I have a C# console app which uses interop to
Well, the title pretty much states it. I want to be able to draw

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.