[Seaside] WARegistry performance

Philippe Marschall philippe.marschall at gmail.com
Sun Dec 14 11:15:29 UTC 2008


2008/12/13, Balázs Kósi <rebmekop at gmail.com>:
> Hi,
>
> We've tested our seaside (2.8) application with ab [1] and found that
> the performance decreases with repeated runs of the benchmark.
> Ab creates a new session for every request, so we've looked into the
> session handling code and found that WARegistry spends O(n)
> time with housekeeping for every new session, where n is the number of
> registered sessions. This means that creating n sessions rapidly
> takes O(n^2) time.

The problem is that reaping the expired session requires iterating
over all the sessions, right?

> SeasideRegistry-ul.3.mcz [2] contains an alternative approach which
> needs O(n) time for n new sessions, amortized O(1) time for every
> session.
> We use a LinkedDictionary, which is a combination of a dictionary and
> a linked list. In the list handlers are sorted by expiration time.
> Every time
> a new session is created we unregister all the expired sessions, which
> can be found at the beginning of the list. When a session is accessed
> then we move it to the end of the list.

And you store the node in the dictionary so you don't have to search for it.

> To try it out you need to load HashTable from [3] first.

Is there any special reason why you don't use dictionary?

> counter_benchmark.pdf [4] contains some benchmarks created with
> autobench [5]. We used Seaside-2.8-578 one-click image. Set the
> backlog
> size to 100 in TcpListener. Some graphs can be found at [6].
>
> What do you think?

It only works when all the sessions have the same lifetime.

Cheers
Philippe


More information about the seaside mailing list