Check if async I/O is enabled in CentOS

Technical, Technology

First, the command:

grep kio /proc/slabinfo

It gives output similar to this:

kioctx 24 60 384 10 1 : tunables 54 27 8 : slabdata 6 6 0
kiocb 7 15 256 15 1 : tunables 120 60 8 : slabdata 1 1 0

Look at the column header in the first line of /proc/slabinfo:

# name <active_objs> <num_objs> <objsize> <objperslab> <pagesperslab> : tunables <limit> <batchcount> <sharedfactor> : slabdata <active_slabs> <num_slabs> <sharedavail>

To distinguish if async I/O is enabled, check first and second columns.  If they are non-zero, that means async I/O is enabled (disabled if all zeros).

To drill a little bit more:

  • Slab allocation is a kernel memory management mechanism to kernel memory usage more efficient, hence improving performance (http://en.wikipedia.org/wiki/Slab_allocation);
  • /proc/slabinfo stores statistics about the Slab allocation;
  • There are many data structures in /proc/slabinfo storing different statistics;
  • Among them, kioctx and kiocb are 2 data structures used to store statistics for async I/O.  Hence, if they are non-zero number of objects for <active_objs> and <num_objs>, async I/O is being used (http://chenguangblog.wordpress.com/2011/03/09/async-io/).
Advertisements

Check free memory in Ubuntu 12.04 LTS and free memory caches

Technical, Technology

Check free memory

free

To free pagecache (remember to do a “sync” beforehand):

echo 1 > /proc/sys/vm/drop_caches

To free dentries and inodes:

echo 2 > /proc/sys/vm/drop_caches

To free pagecache, dentries and inodes:

echo 3 > /proc/sys/vm/drop_caches