-
Notifications
You must be signed in to change notification settings - Fork 1.4k
gunicorn + nginx issues #479
Comments
Re (1): Thanks for reporting the issue! This is a known issue and needs to be addressed in the release notes/documentation. Here's a previous discussion of the issue:
The basic issue is that inference is that the request doesn't return a response until all of the classifications are complete (which could take a very long time). We've prioritized other things for the v3.0 release and didn't have time to get around to it. So far, we've been treating DIGITS as primarily a deployment solution without working to make it a quality inference solution:
But realistically, people are using it for inference and it needs to work - or at least not crash the server. I don't think we can fix this for the v3.0 release because it's a big change that touches some important parts of the code and I don't want to introduce major bugs in-between the RC release and the final release. But it should be documented. I'll work on that. |
Re (2): IIRC, I ran into issues with the SocketIO server when trying to use multiple worker processes. Gunicorn is used mainly because it handles server crashes well. Caffe tends to |
BTW, I'm happy to review submissions to fix any of these issues! |
Maybe I'm overstepping the scope of this discussion, but after reviewing the Scheduler implementation it seems like the entirety of the processing is done inside the Flask application itself. Would an alternative implementation that abstracted the application into 2/3 layer model that explicitly separated Flask and the core neural network functions be more appropriate in this scenario? For instance, Celery could be utilized to run the Scheduler and other job processes in order to allow Flask to assume an observe and report role thus delegating the heavy lifting to something more suited for it. Just my 2¢! |
In the meantime, if you want to get some work done, you might want to use a script similar to this: #!/bin/sh -e
if [ "$#" -ne 3 ]
then
echo Usage: $0 server job_id filename
exit 1
fi
server=$1
job_id=$2
filename=$3
for line in `cat $filename | awk '{ print $1 }'`
do
echo $line
curl -XPOST \
$server/models/images/classification/classify_one.json?job_id=$job_id \
-Fimage_url=$line
done If you break up each image into a separate task, DIGITS will respond much better. |
That is a bit outside the scope of this particular issue, but those are great suggestions. It'd be great if you could open a new issue for this. |
|
The text was updated successfully, but these errors were encountered: