How to write a service that will be a long time to process the request?

There is a task that needs to be solved for each query and this task is quite long (even 10 seconds). How to write a service and configure it to work with Nginx well?
Under "how to write service" I mean how to organize the processing at level of sockets? It should be a epoll? What length should be the buffer from accept()? keep-alive or not?
June 10th 19 at 16:02
2 answers
June 10th 19 at 16:04
better install the server queues and tasks to be put in place by assigning a uuid, the client will periodically poll the server has performed the task or not. otherwise you have the whole pool of queries will quickly become clogged and no one will respond to new queries
June 10th 19 at 16:06
10 seconds
the standard timeout is 30 seconds

Write what you usually write

If the client agrees to look at the animation of the expectations of browser - so nothing special at all should not be written

Find more questions by tags Nginx