busyobj caching

Poul-Henning Kamp phk at phk.freebsd.dk
Thu Dec 8 08:53:05 CET 2011


As you've noticed if you are reading commit mails, Martin and I are
busy moving all the backend fetch related stuff into a the busyobj
structure.

Right now we offer to $param selectable options for memory management
of the busyobj, and I would like to get your input & experience with
this detail.

In one more, we cache a busyobj per worker thread, this is for all
practical purposes the same thing we had before this change.

The other option is to use a single slot global cache, which saves
a bunch of memory in worker threads at the cost of malloc-trafic,
locking and lock contention.

For a site with high hitrates, it may be an advantage to switch to
the single slot global cache by setting busyobj_worker_cache=false
as this will reduce the memory footprint.

The question in my mind, is what every everybody else needs.  On
one hand, a single malloc/free per backend fetch is not a really
big deal performance wise, on the other hand, having a slightly
larger cache than a single entry might be beneficial.

Before I pour any more time into this, I'd like to get some real-world
feedback, so if anybody can measure any difference by changing the
busyobj_worker_cache param, I'd like to hear about it.

This is not a high-priority project, but if you have the chance...

-- 
Poul-Henning Kamp       | UNIX since Zilog Zeus 3.20
phk at FreeBSD.ORG         | TCP/IP since RFC 956
FreeBSD committer       | BSD since 4.3-tahoe
Never attribute to malice what can adequately be explained by incompetence.




More information about the varnish-dev mailing list