How to configure nginx + Unicorn to avoid timeout errors?

孤者浪人 提交于 2019-12-04 04:05:28

This is a good reason to create a queue. And you will:

  • upload csv file (that should be within 30sec)
  • your background job that will import user data (that can go for hours…)
  • while this job is in progress you can serve some kind of WIP page with job status/percents/etc.

Check https://github.com/resque/resque for example. There is a lot of other queues.

Is there a way to handle this kind of problems?

Do the job in background. You should have a separate process that gets jobs from queue one by one and processes them. And since it doesn't work with user requests, it can do its job as long as needed. You don't need unicorn for this, just a separate daemon.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!