Async spawing of processes: design question - Celery or Twisted

后端 未结 3 1818
日久生厌
日久生厌 2021-02-09 15:17

All: I\'m seeking input/guidance/and design ideas. My goal is to find a lean but reliable way to take XML payload from an HTTP POST (no problems with this part), parse it, and s

3条回答
  •  暗喜
    暗喜 (楼主)
    2021-02-09 15:54

    I'll answer this question as though I was the one doing the project and hopefully that might give you some insight.

    I'm working on a project that will require the use of a queue, a web server for the public facing web application and several job clients.

    The idea is to have the web server continuously running (no need for a very powerful machine here). However, the work is handled by these job clients which are more powerful machines that can be started and stopped at will. The job queue will also reside on the same machine as the web application. When a job gets inserted into the queue, a process that starts the job clients will kick into action and spin the first client. Using a load balancer that can start new servers as the load increases, I don't have to bother about managing the number of servers running to process jobs in the queue. If there are no jobs in the queue after a while, all job clients can be terminated.

    I will suggest using a setup similar to this. You don't want job execution to affect the performance of your web application.

提交回复
热议问题