Changing the buffer size is done via the /proc/sys/klogger/buffer_size file by simply writing a new size in units of MB (the size refers to the buffer of each CPU, so the actual memory allocated is , where is the number of processors in the system). Reading the file shows the buffer size allocated for each CPU.
For example, if we want to change the buffer size to 16MB per CPU right after boot the command set would be:
foo[ /proc/sys/klogger ] cat buffer_size 4MB/CPU foo[ /proc/sys/klogger ] echo 16 > buffer_size foo[ /proc/sys/klogger ] cat buffer_size 16MB/CPU(note that although writing to the file is done with only numbers, when reading the file the units are appended to the data).
To avoid stressing the memory by allocating large, physically continuous buffers Klogger uses virtually continuous buffers. However, there is a limit on the kernel's virtual memory size, which is set to 128MB on Linux 2.6.9 kernels. If the total memory allocated exceeds this limit, you can boot the machine with the special vmalloc boot time flag, resetting the kernel's virtual memory limit. For example, when using 128MB buffers on a 4-way machine, we added the vmalloc=640MB boot parameter so the kernel will have enough virtual memory for both the needed by Klogger, alongside the original virtual memory space it uses.
Resetting the low-water mark is done in a similar manner, using the /proc/sys/klogger/lowwater file. The number written to that file is the percent of the memory buffer space below which the buffer will be emptied (default is 10%). For example:
foo[ /proc/sys/klogger ] cat lowwater 10% foo[ /proc/sys/klogger ] echo 5 > lowwater foo[ /proc/sys/klogger ] cat lowwater 5% foo[ /proc/sys/klogger ]