Re: LISP for web



Marco Baringer wrote:
> Brad Anderson <brad@xxxxxxxxxxxxxxx> writes:
>
>
>>Ideas on how to store this information centrally for all of the app
>>servers? I would love to see either a RDBMS (Postgres) or Memcached
>>(http://www.danga.com/memcached/) option.
>>
>>[snip]
>>
>>This would allow me to use UCW not only in personal projects, but at
>>work as well. Any timeline? I can do some testing, although I'm a
>>bit of a newb.
>
>
> we're talking about two different things:
>
> 1) scalability. can you increase the performance of a ucw app by
> adding hardware? two options:
>
> a) manage sessions with cookies and use pound for load balancing
> (www.apsis.ch/pound/). this is by far the simplest solution and
> is doable today with the current ucw code base. you still run
> the risk of losing data and sessions if one of the machines goes
> down and, if you're unlucky, you could still end up with one
> machine serving lots of busy sessions and another sitting
> idly. if you can't use cookies then you'd need to change some of
> ucw's form handling code (to make sure session ids are always
> passed in the url), this is fairly easy but hasn't been done yet
> (and won't get done unless i need it or someone else contributes
> it).
>
> b) store the sessions in a memcache (thanks for the link btw) or an
> rdbms and use lvs (www.linuxvirtualserver.org) to balance the
> work on the machines.

This is what we have in production at work. LVS with session
persistence allowed us to remove the affinity settings by class C
address (keep sessions on one app server) and move to more of a
round-robin or least weighted connections.

> this has the advantage that you won't end
> up with one busy machine and one idle machine and lvs deals hot
> swapping of machines and dead nodes transparently. this has the
> major disadvantage that, as of now, you can't do it since
> there's no way to store a session in anything but local
> ram. once sessions are completly serializable then this requires
> modifying find-session, expire-session and adding a new :after
> method on service (to store the changed session back in the
> db). since each and every request will require first fetching
> the session object and then, just before sending back the html,
> puting the session object back into the store (it has changed in
> the mean time) we will need to make sure session serialization
> doesn't become a bootleneck.

Fast session serialization is the feature I'm interested in. You can
even store the sessions in memcached *and* the database, and if you get
a cache miss, go to the slower database. A new thread can take care of
the session writing to the store, if you can live with 'dirty session
writes' (can't think of a better name). This gets you to sending back
the html faster.

>
> 2) high availablity. can you create a ucw app which is resistent to
> hardware failures? not currently. the load-balancing solution in
> (1.b) can deal with hardware failures an the app servers but this
> leaves the db as a spof. the only 'real' solutions to this is to
> use a db which supports replication and store sessions in the db. i
> think postrgesql can but i haven't checked in a while and i know
> berkeleydb does (though i've never actually used it)).

Agreed, and we have an active/active database cluster (MS SQL Server).
I would like to re-create this with Postgres (and use Slony, maybe?? I
think we'd need to use LVS at this level too, after the replication is
working.)

>
> as far as ucw is concerned the only thing missing is fast session
> serialization and this will happen as soon as I convince someone to
> pay me for it (hint hint hint :)).
>

For now, I'm using UCW on a small personal site, but with these
features, it would be much more attractive to use at work. I'm afraid I
can't pay you yet. I'd need to make some inroads w/ Lisp in other
places first. I'm attempting to displace a J2EE system piece-by-piece,
and I'm starting with the core classes, not the presentation layer.

BA
.



Relevant Pages

  • Re: Storing a datatable (or arraylist )on ASP.NET Session
    ... Perhaps your ArrayList store smth which can't be casted to object. ... If exactly that code u shown didn't work (emply arraylists) that I recomment to re-register asp.net 2.0 calling aspnet_regiis,exe - i ... Team blog: http://devkids.blogspot.com/ ... b> session variables is stored on web server's local sql database. ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: Problem with asp.net app only allowing 1 user at a time
    ... from the client to the server), Application (an object that can store ... Now in your case you are reading and writing everything to the database, ... there is the Session object. ... To retrieve this you would do something like: ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: LISP for web
    ... > Ideas on how to store this information centrally for all of the app ... the risk of losing data and sessions if one of the machines goes ... ucw's form handling code (to make sure session ids are always ...
    (comp.lang.lisp)
  • Re: Caching often-used SQL queries
    ... The problem is that neither one of those are user (session) specific. ... need to enable sessions and store the data in the session context. ... Second - you'd be caching so much data that it would ... And if you tune your database server you'll spend much more time processing ...
    (microsoft.public.dotnet.framework.performance)
  • Re: Dynamic controls query
    ... If they are choosing their own UI, I am assuming they will want to retain ... these settings beyond this session? ... In that case you would store in either a data store (xml file on server, ... in a session variable and call from a postback, ...
    (microsoft.public.dotnet.framework.aspnet)