Differences
This shows you the differences between two versions of the page.
| Both sides previous revision Previous revision Next revision | Previous revision | ||
| dirhashdynamicmemory [2008/06/17 21:37] – converted to 1.6 markup 127.0.0.1 | dirhashdynamicmemory [2009/07/07 10:17] (current) – NickBarkas | ||
|---|---|---|---|
| Line 8: | Line 8: | ||
| Furthermore, | Furthermore, | ||
| + | |||
| + | ===== Plan ===== | ||
| + | |||
| + | * Either change dirhash memory allocation to use buffer cache, or keep existing memory allocation model but register new callback function to free older dirhashes when vm_lowmem events occur. **Done** | ||
| + | * Once code works reasonably well in my own tests, call for testing from the community to shake out more bugs if possible. **Done** | ||
| + | * Test for performance differences with dynamic dirhash vs. static under different work loads (e.g. huge maildirs, subversion fsfs repositories with a great many revisions, different amounts of memory in machine, etc.). **Done** | ||
| + | * Get code in a state suitable for being committed to -CURRENT. **Done** | ||
| + | * (Time permitting) Begin work on on-disk directory indexing in UFS2. **Not done** | ||
| ===== Status ===== | ===== Status ===== | ||
| - | I blog about this project [[http:// | + | I blogged |
| + | |||
| + | (2008-6-19) I am working on implementing a function to be registered with EVENTHANDLER_REGISTER() for vm_lowmem events that will free dirhashes. I am trying to determine how to decide which hashes to free, and will need to find how many should be freed each time this event occurs. Determining the latter might be easiest through trial and error, watching how often vm_lowmem events pop up when the system is low on memory. | ||
| + | |||
| + | (2008-6-27) Here is a patch with a first attempt at freeing dirhashes when a low memory signal is sent: {{dirhashdynamicmemory/ | ||
| + | |||
| + | (2008-7-12) I now have an updated patch: {{dirhashdynamicmemory/ | ||
| + | |||
| + | (2008-8-14) Updated patches again. Now there are two: one against HEAD {{dirhashdynamicmemory/ | ||
| + | |||
| + | (2008-10-8) Results about a whole bunch of new benchmarks are added below. Also, the dirhash code for 8-CURRENT has been updated in perforce to work with some new changes made to the dirhash code in SVN. New patch: {{dirhashdynamicmemory/ | ||
| + | |||
| + | (2008-11-19) My [[http:// | ||
| + | |||
| + | (2009-7-7) I committed the dirhash vm_lowmem handler to -CURRENT about a month ago, and it will be included in 8.0-RELEASE. Also I plan to commit a backport of these changes to 7-STABLE, probably around September. | ||
| + | |||
| + | ===== Benchmarks ===== | ||
| + | |||
| + | I measured the performance of the changes I made to the dirhash code using a Python script that does a number of different operations on large directories, | ||
| + | |||
| + | I ran the tests on both %%FreeBSD%% 7.0 and 8-CURRENT for the AMD64 architecture. A GENERIC kernel is used on 7.0, and on -CURRENT the only change to the GENERIC config is that INVARIANTS and WITNESS related options are disabled. Furthermore malloc debugging is disabled on the -CURRENT system in userland. On the 7.0 system the creation threads deliver a total of 25 000 new messages to maildirs, while on 8-CURRENT I increased this to 50 000 because delivering 25 000 messages would take less time than all the other tasks which run alongside the mail creation threads. | ||
| + | |||
| + | The hardware used for all tests has a 1.8GHz Intel Core 2 Duo, 1GB memory, and a 3.5" 80GB 7200 RPM IDE hard drive. The maildirs are extracted, have messages added, and IMAP operations are done on a secondary hard drive, which is a 2.5" 40GB 5400RPM SATA drive. All tests are run with the system running multiuser, but not much besides sshd, openntpd, and postfix along with normal default %%FreeBSD%% daemons are running in the background. | ||
| + | |||
| + | Each battery of tests is run 5 times for a number of different dirhash settings. Using a kernel without my patch, tests are run with the maximum dirhash memory usage at the default 2MB and 64MB. With the kernel containing the vm_lowmem handler patch, 64MB is used across the board but the dirhash_reclaimage parameter is tweaked. On 7.0, 1s, 3s, 5s, and 10s are all tried for reclaim age, and on 8-CURRENT all these values are tried in addition to 4s and 8s. I put the results from all the test runs into a Gnumeric spreadsheet here: {{dirhashdynamicmemory/ | ||
| + | |||
| + | ==== FreeBSD 7.0 Results ==== | ||
| + | |||
| + | {{dirhashdynamicmemory/ | ||
| + | {{dirhashdynamicmemory/ | ||
| + | {{dirhashdynamicmemory/ | ||
| + | {{dirhashdynamicmemory/ | ||
| + | {{dirhashdynamicmemory/ | ||
| + | {{dirhashdynamicmemory/ | ||
| + | {{dirhashdynamicmemory/ | ||
| + | {{dirhashdynamicmemory/ | ||
| + | |||
| + | ==== FreeBSD 8-CURRENT Results ==== | ||
| + | |||
| + | {{dirhashdynamicmemory/ | ||
| + | {{dirhashdynamicmemory/ | ||
| + | {{dirhashdynamicmemory/ | ||
| + | {{dirhashdynamicmemory/ | ||
| + | {{dirhashdynamicmemory/ | ||
| + | {{dirhashdynamicmemory/ | ||
| + | {{dirhashdynamicmemory/ | ||
| + | {{dirhashdynamicmemory/ | ||