title: Rails - Unable to create records from csv file on VPS
body: <p>I have deployed my rails app on VPS. I have a feature of uploading csv file and creating records based on the file rows. I am using this feature in ActiveAdmin.</p>
  
  <p>On click of the upload button I call the <code>import_csv</code> method through Ajax call.</p>
  
  <p>the method is as follows:</p>
  
  <pre><code>collection_action :import_csv, method: :post do
      CSV.foreach(params[:file].path, headers: true) do |row|
        item = Item.where(code: row["code"]).first || Item.new
        row["status"] = row["status"].downcase if row["status"]
        row["created_by"] = current_user.get_name
        row["modified_by"] = current_user.get_name
        item.attributes = row.to_hash
        item.save!
      end
      render text: { success: "Successfully imported" }.to_json
  end
  </code></pre>
  
  <p>So on success I get the alert as <code>"Successfully imported"</code> and if there is any error I get the alert of <code>"Something went wrong."</code>which is set in the error block of Ajax call.</p>
  
  <p>Now the question is:</p>
  
  <p>I am not able to create records through CSV file for the Item model. My CSV file contains almost 70k rows. I am able to create records up to 7500.
  If I put 7501 rows in CSV file I get alert as <code>"Something went wrong"</code>. </p>
  
  <p>Also in logs I can't see any error. In fact if there are 7501 rows I even can't see the request hit to the <code>import_csv</code> method.</p>
  
  <p>This happens only on VPS. On local in both development and production mode I am able to create all 70k records.</p>
  
  <p>Can any one help with this? How can I track what is actually causing the error?</p>
  
  <p>EDIT:</p>
  
  <p>At a time in the CSV file I can put 7500 rows and create records. Next time again I ca upload a file with 7500 rows and create records successfully. </p>
  
  <p>At one single time, I am not able to put rows more than 7500 in the file to create records.</p>