Cache.ram is not "completely" useless in a multi processes. If your caching the entire html output of your front page, then its faster to have this cached in ram instead of on disk, but its not a big deal since its ok for new threads to recreate the cache in this single instance.
Also if your running on latest stable web2py code, it does include some cache statistics in appadmin, including memory usage if you have guppy heapy installed -Thadeus On Fri, Feb 26, 2010 at 7:07 AM, szimszon <[email protected]> wrote: > Nice. TNX. > > On febr. 26, 11:25, Graham Dumpleton <[email protected]> > wrote: >> For a further explanation of different modes you can run application >> under with Apache/mod_wsgi read: >> >> http://code.google.com/p/modwsgi/wiki/ProcessesAndThreading >> >> Graham >> >> On Feb 26, 7:42 pm, mdipierro <[email protected]> wrote: >> >> >> >> > it is not useless. It works of if you run only one wsgi process but >> > cache lives only within the lifetime of the process. >> >> > On Feb 26, 2:32 am, szimszon <[email protected]> wrote: >> >> > > Okay. It looks good now. Thanks for the prompt replay. >> >> > > But if I understand well than the cache.ram is useless all the time >> > > apache is used? >> >> > > On febr. 26, 09:10, mdipierro <[email protected]> wrote: >> >> > > > The fact is the web server may be restarting the process or running >> > > > more than one process. Apache does the same. In this case you should >> > > > use cache.disk, not cache.ram. >> >> > > > On Feb 26, 1:34 am, szimszon <[email protected]> wrote: >> >> > > > > Hello! >> >> > > > > I wonder if somebody could it confirm: >> >> > > > > I have a db: >> > > > > ------- cut -------- >> > > > > db.define_table('guestbook', >> > > > > Field('email','string', >> > > > > label=T("E-Mail"), >> > > > > requires=IS_EMAIL()), >> > > > > Field('nick','string', >> > > > > label=T("Nickname"), >> > > > > requires=IS_NOT_EMPTY()), >> > > > > Field('ts','datetime', >> > > > > label=T("Date"), >> > > > > default=request.now, >> > > > > writable=False, >> > > > > readable=False), >> > > > > Field('text','string', >> > > > > label=T("Text"), >> > > > > requires=IS_NOT_EMPTY()), >> > > > > ) >> > > > > ------- cut -------- >> >> > > > > A controller: >> > > > > ------- cut -------- >> > > > > def flush_cache(form=None): >> > > > > cache.ram.clear() >> >> > > > > def vendegkonyv(): >> > > > > lista=None >> > > > > if (( auth.user_id==1 ) and (request.vars.r)): >> >> > > > > form=SQLFORM(db.guestbook,request.vars.r,deletable=True,onaccept=flush_cach >> > > > > e) >> > > > > else: >> > > > > form=SQLFORM(db.guestbook,onaccept=flush_cache) >> > > > > #form=SQLFORM.factory() >> > > > > if not auth.user_id: >> > > > > form[0].append(Recaptcha(request, >> > > > > "...", >> > > > > "...")) >> > > > > if form.accepts(request.vars, session): >> > > > > response.flash = "Record updated" >> > > > > flush_cache() >> > > > > elif form.errors: >> > > > > response.flash = "Error" >> > > > > flush_cache() >> >> > > > > try: >> > > > > lista=db(db.guestbook.id>0).select(orderby=~db.guestbook.ts, >> > > > > cache=(cache.ram,120)) >> > > > > except: >> > > > > pass >> > > > > return dict(form=form,lista=lista) >> > > > > ------- cut -------- >> >> > > > > And a view: >> > > > > ------- cut -------- >> > > > > {{extend 'layout.html'}} >> >> > > > > <h1>GuestBook</h1> >> > > > > <div> >> > > > > {{=form}} >> > > > > </div> >> > > > > {{if lista:}} >> > > > > <table class="vendegkonyv"> >> > > > > <tr> >> > > > > <th>{{=db.guestbook.ts.label}}</th> >> > > > > <th>{{=db.guestbook.nick.label}}</th> >> > > > > <th>{{=db.guestbook.text.label}}</th> >> > > > > </tr> >> > > > > {{for elem in lista:}} >> > > > > <tr> >> > > > > <td> >> > > > > {{if (auth.user_id==1):}} >> >> > > > > {{=A(elem.ts,_href=URL(r=request,f='vendegkonyv',vars=dict(r=elem.id)))}} >> > > > > {{else:}} >> > > > > {{=elem.ts}} >> > > > > {{pass}} >> > > > > </td> >> > > > > <td>{{=elem.nick}}</td> >> > > > > <td>{{=elem.text}}</td> >> > > > > </tr> >> > > > > {{pass}} >> > > > > </table> >> > > > > ------- cut -------- >> >> > > > > With the cherrypy isn't a problem but with apache2 and wsgi: >> >> > > > > 1, I make 3-4 post to the guest book >> > > > > 2, delete them >> > > > > 3, reload the page with a link on page pointing to self to guestbook >> >> > > > > I see 0 to 3-4 post on each click randomly which are nonexistent >> > > > > posts >> > > > > anymore :( > > -- > You received this message because you are subscribed to the Google Groups > "web2py-users" group. > To post to this group, send email to [email protected]. > To unsubscribe from this group, send email to > [email protected]. > For more options, visit this group at > http://groups.google.com/group/web2py?hl=en. > > -- You received this message because you are subscribed to the Google Groups "web2py-users" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/web2py?hl=en.

