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 8520023
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T06:25:02+00:00 2026-06-11T06:25:02+00:00

Right now I have something like this in my CodeIgniter model: <?php $array =

  • 0

Right now I have something like this in my CodeIgniter model:

<?php 
$array = array(...over 29k IDs...);
$update = array();
foreach ($array as $line) {
   $update[] = array('id' => $line, 'spintax' => $this->SpinTax($string));
   ### $this->SpinTax parses the spintax from a string I have. It has to be generated for each row.
}
$this->db->update_batch('table', $update, 'id');
?>

The first 20k records get updated just fine, but I get a 504 Gateway Time-out before it completes.

I have tried increasing the nginx server timeout to something ridiculous (like 10 minutes), and I still get the error.

What can I do to make this not timeout. I’ve read many answers and HOW-TOs to segment the update, but I continue to get the server timeout. A PHP or CodeIgniter solution would be excellent, and I need to deploy this code to multiple servers that might not be using nginx (similar error in Apache).

Thanks in advance.

  • 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-11T06:25:04+00:00Added an answer on June 11, 2026 at 6:25 am

    You’ll likely need to run this through command line and set_time_limit(0). IF you’re in codeigniter, check this out on how to run a command line through the user guide. http://codeigniter.com/user_guide/general/cli.html

    Now, before you do that, you mentioned you are using array chunk. If you’re getting all the values from the database, no need to use array_chunk. Just set a get variable for instance.
    /your/url?offset=1000, when that finishes, do a redirect to the same thing, but with 2000 and so on until it finishes.

    Not the nicest or cleanest, but will likely get it done.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Right now I have something in php that looks like this: $count = array_count_values($result);
Right now I have something like this in NHibernate: Expression.Like(property, value, MatchMode.Anywhere) and that
Right now I have something like this: <div id=pagebody> <div id=left-entries> </div> <div id=right-entries>
Right now I have something like this: <%= render :partial => widgets/type1.html.erb, :locals =>
So right now if I have something like this: //div[@class='artist']/p[x]/text() x can either be
Right now I have something like this.... Item.find({}, function (docs) { for (var i
Right now in some Java code I have something like this class A {
right now I have something like this for my s3.yml: development: bucket: mydev access_key_id:
In my code right now I have something like this: state.BytesRead += readPacket.Result; if
Simple question; right now I have something like this: typedef void(*MyFunctionPointer)(int); typedef std::vector <

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.