Fixing broken pipe error in uWSGI with Python
it depends on your frontend server. For example nginx has the uwsgi_read_timeout parameter. (generally set to 60 seconds). The uWSGI http router as the --http-timeout default to 60 seconds and so on. As you are talking about a rest api i am quite doubtful it requires more than 60 seconds to generate a response, are you sure you do not have some wrong response header triggering a connection close by the frontend webserver ?
if you are using the uwsgi
nginx plugin, consider using
uwsgi_connect_timeout 180;
uwsgi_read_timeout 180;
uwsgi_send_timeout 180;