[web2py] Re: cache.action

2019-09-17 Thread Attilio Drei
for information, using web2py with python3 and gunicorn/meinheld, i am able to do 1000 queries per second using a redis backend and 1 key seek., in this case i set db to sqlite:memory. GUNICORN_CMD_ARGS=" --workers=6 --worker-class=meinheld.gmeinheld.MeinheldWorker"python3 //web2py/a

[web2py] Re: cache.action

2019-09-16 Thread Massimo Di Pierro
No. That is why I am making py4web and it is 20x faster. On Monday, 16 September 2019 23:02:02 UTC-7, Attilio Drei wrote: > > hi, when i set a cache action still web2py continue to do queries to > database for every call. ( select 1; commit) > is possible to set db to null or sqlite:memory when

[web2py] Re: cache.action decorator generates an error

2015-10-17 Thread Krzysztof Socha
Just a little add-on: it seems now to work fine, if *time_expire>0*. It only fails for *time_expire=0*. So I guess it is an improvement :) When will this be fixed in a stable release? Or should I use the github version for my production server? Cheers, Krzysztof. On Saturday, October 17, 2015

[web2py] Re: cache.action decorator generates an error

2015-10-17 Thread Krzysztof Socha
I cloned repo from github, and now I get: type 'exceptions.UnboundLocalError'> local variable 'expires' referenced before assignment I guess something was fixed, but something else got broken? More details: File "/opt/web2py/gluon/cache.py", line 680, in wrapped_f 'Expires' : expires, Unbou

[web2py] Re: cache.action decorator generates an error

2015-10-16 Thread Massimo Di Pierro
This may be fixed in trunk. Can you please check it. On Wednesday, 14 October 2015 13:03:01 UTC-5, Krzysztof Socha wrote: > > Hi, > > I am trying to configure caching on my site, but it does not seem to work. > As soon as I use the cache.action decorator, such as: > > @cache.action(time_expire=0,

Re: [web2py] Re: @cache.action not working properly with nginx, is any additional configuration required?

2015-05-20 Thread Lisandro
Thanks Niphlod, and Paolo too. With your last comments I understand a little better. Sorry about the web2py / nginx confusion. I know I'm going way beyond my limits, but for now there's no budget for more :( I understand a bit more about the problem of caching in memory when there are multiple

Re: [web2py] Re: @cache.action not working properly with nginx, is any additional configuration required?

2015-05-20 Thread Niphlod
halt!. Either you use web2py (and we can help with that) OR nginx (and you'll need to cfr THEIR support for a proper config). There's no facility whatsoever for web2py to cache the object and for nginx to fetch it from the same memcached instance. That being said, using cache.ram in multipr

Re: [web2py] Re: @cache.action not working properly with nginx, is any additional configuration required?

2015-05-20 Thread Lisandro
Do you mean that it should work adding only that lines in models/0_memcache.py? I've tried that but the results are still the same :/ I was asking about the nginx/uwsgi part because I thought some configuration was required. In case it doesn't require any additional configuration to nginx/uwsgi,

Re: [web2py] Re: @cache.action not working properly with nginx, is any additional configuration required?

2015-05-20 Thread Paolo Valleri
The web2py part you have posted is more than enough. Did you try it? memcache with nginx is an other thing Paolo 2015-05-20 15:03 GMT+02:00 Lisandro : > Thank you very much for the clarification. > > Do you know about some example of nginx+uwsgi configuration with memcache? > I've already read

[web2py] Re: @cache.action not working properly with nginx, is any additional configuration required?

2015-05-20 Thread Lisandro
Thank you very much for the clarification. Do you know about some example of nginx+uwsgi configuration with memcache? I've already read this documentation: http://web2py.com/books/default/chapter/29/13/deployment-recipes#Memcache http://nginx.org/en/docs/http/ngx_http_memcached_module.html I've

[web2py] Re: @cache.action not working properly with nginx, is any additional configuration required?

2015-05-20 Thread Paolo Valleri
this is the correct behavior in a multi-process/multi-thread environment because cache.ram is not shared across them. use either memcache or redis to have a global cache Paolo On Wednesday, May 20, 2015 at 1:46:48 PM UTC+2, Lisandro wrote: > > Are there any special consideration about @cache.act

[web2py] Re: cache.action questions (views with db selects, and different views for logged-in users)

2013-10-21 Thread Anthony
> Niphlod, I'm not sure what you're referring to by the "user" parameter. > The closet parameters to "user" would be "session" and "public". But I > don't see these options helping to differentiate between logged in and > non-logged for caching. > The "session" arg doesn't differentiate betwe

[web2py] Re: cache.action questions (views with db selects, and different views for logged-in users)

2013-10-21 Thread Mark Li
Thanks Niphlod and Anthony! That answered my question about caching views with database selects. However, my problem with client-side caching differently for logged-in and non-logged in users is still a problem. Niphlod, I'm not sure what you're referring to by the "user" parameter. The closet

[web2py] Re: cache.action questions (views with db selects, and different views for logged-in users)

2013-10-21 Thread Anthony
> For users who aren't logged in, the pages would be the same. However, if a > user is logged in, then there are links to the users' profile, as well as a > logout link; thus making the page different for every user, and different > for logged-in vs. non-logged-in users. Is there any way to ef

[web2py] Re: cache.action questions (views with db selects, and different views for logged-in users)

2013-10-21 Thread Anthony
> Secondly, cache.action can't be used to cache views with database selects. >> However, if the database select was converted to a list/dict, with >> as_list() or as_dict(), would caching the page with cache.action be >> possible (this would make it pickleable as a regular dictionary)? >> > >

[web2py] Re: cache.action questions (views with db selects, and different views for logged-in users)

2013-10-21 Thread Niphlod
On Monday, October 21, 2013 8:25:22 AM UTC+2, Mark Li wrote: > > I have 2 questions about cache.action > > Firstly, I am looking into cache.action to cache several static pages > (about, contact, etc), that rarely change content. > > For users who aren't logged in, the pages would be the same. H