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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T16:16:47+00:00 2026-06-16T16:16:47+00:00

I am building a rails 3.2 application which allows users to import contacts from

  • 0

I am building a rails 3.2 application which allows users to import contacts from CSV file. If any contact row in the CSV file contains validation errors, none of the contacts are imported and the errors are shown to the user in a CSV file. For example, if a contact CSV has 20 rows, with 4 and 15 rows having errors, none of the contact will be imported and user will be shown errors for both 4th and 15th row of the CSV.

I have done this functionality by reading each row at a time and ‘build‘ records in an array using ‘Contact.new‘. If errors are not present, I save all the contacts by iterating the array else show errors present.

If the number of rows increases to say 40, then it takes around 20 minutes to import the contacts which is bad. Is there any way to increase its performance?

UPDATE:
I had this app deployed on Heroku with Unicorn. If I import this CSV of 40 contacts, app crashes after 30 seconds, however all the contacts are imported. Following are the logs that caused app to crash:

2012-12-26T15:40:28+00:00 app[web.1]: E, [2012-12-26T15:40:27.233802 #2] ERROR -- : worker=0 PID:54 timeout (31s > 30s), killing
2012-12-26T15:40:29+00:00 app[web.1]: E, [2012-12-26T15:40:29.724725 #2] ERROR -- : reaped #<Process::Status: pid 54 SIGKILL (signal 9)> worker=0
2012-12-26T15:40:32+00:00 app[web.1]: Disconnected from ActiveRecord
2012-12-26T15:40:33+00:00 app[web.1]: Disconnected from Redis

Any idea on this?

  • 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-16T16:16:49+00:00Added an answer on June 16, 2026 at 4:16 pm

    Is that a typo or did you really say it takes 20 minutes to import 40 records from a CSV file? If that’s the case, there is something seriously wrong with your setup. Or your “contacts” must have a bazillion data fields and validations or something :/

    As for heroku… heroku will timeout after 30 seconds. It does this to prevent runaway web requests. Their official answer is to move it to a background job and process it there.

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

Sidebar

Related Questions

I am building a Rails application which allows a user to create an object
I'm building a Rails application which lets users have like a personal folder where
I am building a Rails application that contains Developer s who have Application s.
I am in the process of building a rails/flex application which requires audio to
I am building a Rails application accessing a legacy system. The data model contains
I am building a rails application that lets users upload and listen to songs.
I have a SharePoint server. I am building an rails application which can interact
I am building an application which will send status requests to users (via email
I'm building a chatroom application, and I want to keep track of which users
I'm building a Rails application that deals with file uploads through CarrierWave. Currently, larger

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.