http://projects.unbit.it/uwsgi/wiki/CachingFramework
I've been trying to follow this howto and get access to cache via nginx - and
there was no success. After patching source of uwsgi - I can be quite sure:
this sample failed to work for me.
nginx version: nginx/1.2.1
virtual host configconfig
upstream web_upstream {
ip_hash;
server localhost:50001;
}
server {
server_name mysite;
error_log /var/log/nginx/mysite.log debug;
default_type text/html;
charset utf-8;
include uwsgi_params;
set $web_root /;
root $web_root;
location / {
set $key anonymous::$request_uri;
uwsgi_cache_methods GET HEAD;
uwsgi_pass localhost:50001;
uwsgi_modifier1 111;
uwsgi_modifier2 3;
uwsgi_param key $key;
# uwsgi_param get $key;
uwsgi_pass_request_headers off;
error_page 404 502 504 = @upstream;
}
location @upstream {
uwsgi_modifier1 0;
uwsgi_modifier2 0;
uwsgi_pass_request_headers on;
uwsgi_pass web_upstream;
}
}
uwsgi 1.2.3
app config
<apps>
<uwsgi id="%n">
<master/>
<process>4</process>
<workers>10</workers>
<threads>10</threads>
<max-requests>10000</max-requests>
<reload-on-as>128</reload-on-as>
<reload-on-rss>96</reload-on-rss>
<socket>localhost:50001</socket>
<pidfile>/var/run/uwsgid/%n.pid</pidfile>
<pythonpath>/var/www/%n</pythonpath>
<env>DJANGO_SETTINGS_MODULE=web.settings</env>
<module>django.core.handlers.wsgi:WSGIHandler()</module>
<logto>/var/log/uwsgid/%n.log</logto>
<touch-reload>/var/www/%n</touch-reload>
<cache-blocksize>196608</cache-blocksize>
<cache>1000</cache>
<listen>1024</listen>
</uwsgi>
</apps>
Well, I can use uwsgi cache within django project, but still can not make it
working with nginx.
And one more question: why pickle is used at sample caching backend? can i
store raw python objects?
Thanks in advance.
--
Regards,
Lev Lemkov
_______________________________________________
uWSGI mailing list
[email protected]
http://lists.unbit.it/cgi-bin/mailman/listinfo/uwsgi