[PATCH] backend conditional requests third release
Geoff Simmons
geoff at uplex.de
Mon Mar 7 11:35:49 CET 2011
Hello everyone,
This is the third version of the conditional backend request feature,
which fixes the bug I mentioned on the -dev list yesterday -- a memory
leak and assertion failures during load tests. With this change I can
now run load tests with httperf without any such errors.
The load test isn't much of a performance test for Varnish -- I'm
running httperf, Varnish and an Apache backend all on my machine,
getting a maximum client request rate of about 18000/s, no challenge for
Varnish. The point was to find out errors that only show themselves
under load, and to see the differences with and without the IMS feature.
So if any of you are able to test the patch under a heavy load, it would
certainly be worthwhile.
For those who are interested in what the problem was: I was arranging
for removal of the stale_obj after it's no longer needed by doing this
(simplified a bit):
EXP_Clr(&stale_obj->exp);
HSH_Deref(&stale_obj);
if (stale_obj == NULL)
EXP_Rearm(stale_obj);
But I had overlooked that HSH_Deref(o) always sets o to NULL. So
EXP_Rearm() was never called, and the stale_obj's continued to take up
space in storage, enough so that malloc storage was eventually full.
Eventually when STV_NewObject() was called to create a new object from
the backend response during fetch, the allocation call sma_alloc() hit
the limit sma_max, causing it to return NULL, and that leads to assert
failures.
The fix was just to call EXP_Rearm() before HSH_Deref().
Best,
Geoff
--
** * * UPLEX - Nils Goroll Systemoptimierung
Schwanenwik 24
22087 Hamburg
Tel +49 40 2880 5731
Mob +49 176 636 90917
Fax +49 40 42949753
http://uplex.de
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: patch.conditional_backend_reqs
URL: <https://www.varnish-cache.org/lists/pipermail/varnish-dev/attachments/20110307/e423c37a/attachment-0003.ksh>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 896 bytes
Desc: OpenPGP digital signature
URL: <https://www.varnish-cache.org/lists/pipermail/varnish-dev/attachments/20110307/e423c37a/attachment-0003.pgp>
More information about the varnish-dev
mailing list