Skip to content

Instantly share code, notes, and snippets.

@KristianLyng
Created April 8, 2011 01:18
Show Gist options
  • Select an option

  • Save KristianLyng/909125 to your computer and use it in GitHub Desktop.

Select an option

Save KristianLyng/909125 to your computer and use it in GitHub Desktop.
Testing grace
=============
1. Set up two web servers (already done)
2. Normally, Varnish should balance between both
3. For /cgi-bin/, make Varnish always use Apache
4. Test the test.cgi script wit the sleep-statement
5. Make test.cgi cache, either by editing the script or forcing it in
Varnish
6. Make both /grace/test.cgi and /nograce/test.cgi rewrite to
/cgi-bin/test.cgi
7. Set req.grace = 30s for /grace/test.cgi and req.grace = 0s for
/nograce/test.cgi
Both /nograce/test.cgi and /grace/test.cgi should now function identically
if accessed once at a time.
Try executing two requests at the same time to both /grace/test.cgi and
/nograce/test.cgi . For /nograce/test.cgi, both requests should sleep,
while for /grace/test.cgi, the second request should finish fast.
8. Add a conditional 2 hour grace period if the selected backend is sick,
and test /grace and /nograce again, first with both web servers up, and
then with Apache disabled.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment