[mirrorbrain-commits] r8226 - /trunk/docs/tuning.rst

From: <poeml_at_mirrorbrain.org>
Date: Sun, 14 Nov 2010 14:00:17 -0000
Author: poeml
Date: Sun Nov 14 15:00:14 2010
New Revision: 8226

URL: http://svn.mirrorbrain.org/viewvc/mirrorbrain?rev=8226&view=rev
Log:
docs/tuning:
- explain how to fix intermittent hangs, by preventing kernel write floods.

Modified:
    trunk/docs/tuning.rst

Modified: trunk/docs/tuning.rst
URL: http://svn.mirrorbrain.org/viewvc/mirrorbrain/trunk/docs/tuning.rst?rev=8226&r1=8225&r2=8226&view=diff
==============================================================================
--- trunk/docs/tuning.rst (original)
+++ trunk/docs/tuning.rst Sun Nov 14 15:00:14 2010
_at_@ -335,5 +335,34 @@
    (value is in milliseconds).
 
 
-
-
+Preventing kernel "write floods"
+^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+
+The kernel might decide to write a whole bunch of changes to disk in one step.
+This might block other operations for several seconds. That's deadly for
+performance of a web server.
+
+This may affect you if you run a huge MirrorBrain database (like, say, 1 GB in
+size) in conjunction with heavy write activity (scanning many mirrors).
+
+You should first make sure that you have followed all the tuning advice given
+above. 
+
+Now, if 
+
+1) that is all fine and
+2) you are sure that your database server principally has enough memory and
+3) you see webserver hangs occuring intermittently and
+4) there is no other memory-intensive task to be done by the database server
+
+then you can tune your kernel to handle write in a (for us) more efficient way.
+(The kernel finds it more efficient, by default, to wait a while until there is
+a lot to write -- for us it is more efficient to write out data more
+frequently, in smaller portions.)
+
+The two kernel tunables that let us achieve the desired behaviour are::
+
+    vm.overcommit_memory = 2
+    vm.dirty_background_ratio = 0
+
+Put them into :file:`/etc/sysctl.conf` to make it a permanent change.




_______________________________________________
mirrorbrain-commits mailing list
Archive: http://mirrorbrain.org/archive/mirrorbrain-commits/

Note: To remove yourself from this list, send a mail with the content
 	unsubscribe
to the address mirrorbrain-commits-request_at_mirrorbrain.org
Received on Sun Nov 14 2010 - 14:00:21 GMT

This archive was generated by hypermail 2.3.0 : Mon Feb 20 2012 - 23:47:04 GMT