I have a webapp that is using an API built on nginx, uWSGI, and Django. Recently I have been seeing a lot of harakiris on a particular API call which does some quick processing and then spawns a few threads to handle some long-running functions. The main thread then returns and the worker threads store their results in a cache and exit. After the threads are spawned, there is no interaction between them.
My uWSGI is set to harakiri at 20 seconds. This should be ample time for the main thread to finish and return (it's average is about 2-3 seconds). Is it possible that uWSGI is harakiri-ing because my worker threads are taking too long to return? If so, could I fix this by using multiprocessing instead of multithreading in python?
Thanks!