Title: PHP and Jquery Ajax Batch Processing Big data
Last modified: April 2, 2020

---

# PHP and Jquery Ajax Batch Processing Big data

 *  [saurav.rox](https://wordpress.org/support/users/sauravrox/)
 * (@sauravrox)
 * [6 years, 2 months ago](https://wordpress.org/support/topic/php-and-jquery-ajax-batch-processing-big-data/)
 * I am trying to batch process data using jquery Ajax and PHP. The problem is I
   am getting timeout issue because of the big data. The request never gets completed
   and the process dies in the middle.
 * One way could be to run ajax for certain time and then return the available response
   in chunk as the request is not completed in a single request. So, to sort out
   this issue, I tried using setTimeout so that the ajax runs multiple times but
   only for fixed amount of time. However, I am stuck in the middle. Checked some
   threads over here but had no help.
 *     ```
       function UpdateStatus(){
           $.getJSON(
             "fetch.php",
             {
             },
             function (data, textStatus){
               setTimeout(UpdateStatus, 10000);
             }
           );
         }
         UpdateStatus();
       ```
   
 * Can someone please shade some light on this?
 * Any help would be more than appreciable.

Viewing 2 replies - 1 through 2 (of 2 total)

 *  [a2hostingrj](https://wordpress.org/support/users/a2hostingrj/)
 * (@a2hostingrj)
 * [6 years, 2 months ago](https://wordpress.org/support/topic/php-and-jquery-ajax-batch-processing-big-data/#post-12625586)
 * What’s your PHP Max Execution Time? What’s your PHP time limit?
 * If the data is too big, may be you have to change the way you are doing this.
   You could:
 * 1. Run REST API from your server asynchronously (look up asynchronous curl or
   node.js)
    2. Query your server for status (maybe every 10 secs)
 *  Thread Starter [saurav.rox](https://wordpress.org/support/users/sauravrox/)
 * (@sauravrox)
 * [6 years, 1 month ago](https://wordpress.org/support/topic/php-and-jquery-ajax-batch-processing-big-data/#post-12662642)
 * Thank you [@a2hostingrj](https://wordpress.org/support/users/a2hostingrj/) for
   replying.
 * The time limit is set maximum. I have already changed the default 30 seconds.
   
   The problem is I am not fetching data from database. If I had been working with
   database then may be I would be diving the data into chunk may be using Primary
   Id and all. I don’t know how to do in the situation where you don’t know how 
   big of the data you are dealing with. I still believe this can be achieved using
   Php and jquery ajax. Can you please elaborate the points you have mentioned above?
 * Thank you.

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘PHP and Jquery Ajax Batch Processing Big data’ is closed to new replies.

## Tags

 * [ajax](https://wordpress.org/support/topic-tag/ajax/)
 * [batch](https://wordpress.org/support/topic-tag/batch/)
 * [jquery](https://wordpress.org/support/topic-tag/jquery/)
 * [php](https://wordpress.org/support/topic-tag/php/)

 * In: [Developing with WordPress](https://wordpress.org/support/forum/wp-advanced/)
 * 2 replies
 * 2 participants
 * Last reply from: [saurav.rox](https://wordpress.org/support/users/sauravrox/)
 * Last activity: [6 years, 1 month ago](https://wordpress.org/support/topic/php-and-jquery-ajax-batch-processing-big-data/#post-12662642)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
