Thank you. That was very helpful. I will try redis. There is one other error I get sometimes. I get the error “AttributeError: ‘module’ object has no attribute ‘tokenizer_porter’”. To clarify what I am doing is sentiment analysis using GridSearchCV/Pipeline and Logistic Regression. It requires a param_grid which requires a vect__tokenizer. This params requires a function which I named tokenizer_porter. I guess when joblib does a load it is looking for the function. I tried to use an anonymous function but that did not work. What is strange if I created a lamba declaration name tokenizer_porter before the load it only works in global space or in if __name__ == ‘__main__’: . But it seems to fail when I place the code in a method. Being new to python/flask/gunicorn I find this has been challenging. Any ideas on this one? Also is there other alternatives to gunicorn that would not have these issues. Perhaps Passenger? I have used that in my ruby on rails application.