Dear all,

There is now a version on bitbucket, which works quite nice 
and stable, as far i can tell. I have split up the rather 
coarse lock of all pools and introduced finer locks for 
waiting queue (wqueue) and thread queue (tqueue) per pool.  
The changes lead to significant finer lock granularity and 
improve scalability.

I have tested this new version with a synthetic load of 120 
requests per seconds, some slower requests and some faster 
ones, and it appears to be pretty stable. This load keeps 
about 20 connection threads quite busy on my home machine. 
The contention of the new locks is very little: on this test 
we saw 12 busy locks on 217.000 locks on the waiting queue, 
and 9 busy locks out of 83.000 locks on the thread queue. 
These measures are much better than in current naviserver, 
which has on the same test on the queue 248.000 locks with 
190 busy ones. The total waiting time for locks is reduced 
by a factor of 10. One has to add, that it was not so bad 
before either. The benefit will be larger when multiple 
pools are used.

Finally i think, the code is clearer than before, where the 
lock duration was quite tricky to determine.

opinions?
-gustaf neumann

PS: For the changes, see: 
https://bitbucket.org/gustafn/naviserver-connthreadqueue/changesets 

PS2: have not addressed the server exit signaling yet.

On 29.10.12 13:41, Gustaf Neumann wrote:
> A version of this is in the following fork:
>
> https://bitbucket.org/gustafn/naviserver-connthreadqueue/changesets
>
> So far, the competition on the pool mutex is quite high, but
> i think, it can be improved. Currently primarily the pool
> mutex is used for conn thread life-cycle management, and it
> is needed from the main/drivers/spoolers as well from the
> connection threads to update the idle/running/.. counters
> needed for controlling thread creation etc. Differentiating
> these mutexes should help.
>
> i have not addressed the termination signaling, but that's
> rather simple.
>
> -gustaf neumann
>
> On 28.10.12 03:08, Gustaf Neumann wrote:
>> i've just implemented lightweight version of the above (just
>> a few lines of code) by extending the connThread Arg
>> structure; ....
>
> ------------------------------------------------------------------------------
> The Windows 8 Center - In partnership with Sourceforge
> Your idea - your app - 30 days.
> Get started!
> http://windows8center.sourceforge.net/
> what-html-developers-need-to-know-about-coding-windows-8-metro-style-apps/
> _______________________________________________
> naviserver-devel mailing list
> naviserver-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/naviserver-devel


------------------------------------------------------------------------------
Everyone hates slow websites. So do we.
Make your web apps faster with AppDynamics
Download AppDynamics Lite for free today:
http://p.sf.net/sfu/appdyn_sfd2d_oct
_______________________________________________
naviserver-devel mailing list
naviserver-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/naviserver-devel

Reply via email to