[linux-lvm] LVM2 scalability within volume group

Alasdair G Kergon agk at redhat.com
Fri Mar 26 22:34:03 UTC 2004


On Mon, Mar 22, 2004 at 02:41:45PM -0800, Dave Olien wrote:
> While this is a big improvement, 15 second still seems a long time
> for adding that 200th PV.  Likewise 29 seconds to activate the VG
> is much better.  But can these be made faster?

Yes, I've a list of performance enhancements waiting to be made - they
aren't top priority yet though.
 
> Can these user-level commands be made smarter in this regard?

Yes.  
  (a) Additional internal state can be written to the cache file.
      [The index of which PVs are in which VGs; the index of which
       UUIDs were found on which devices.]
  (b) Some disk reads are still duplicated and can be cached safely.

> Is this something that using the lvm(8) shell would help?  

Yes, this is equivalent to point (a).
Either pipe the commands through it, or try linking against
the library I checked into CVS today.  
(configure --enable-cmdlib;  brief docn in lvm2cmd.h)

Quick example prog below.

Alasdair



#include "lvm2cmd.h"
 
/* All output gets passed to this function line-by-line */
void test_log_fn(int level, const char *file, int line, const char *format)
{
	/* Extract and process output here instead of printing it */

        if (level != 4)
                return;
 
        printf("%s\n", format);
        return;
}
 
int main(int argc, char **argv)
{
        void *handle;
        int r;
 
        lvm2_log_fn(test_log_fn);
 
        handle = lvm2_init();
 
        lvm2_log_level(handle, 1);
        r = lvm2_run(handle, "vgs --noheadings vg1");

	/* More commands here */
 
        lvm2_exit(handle);
 
        return r;
}
 





More information about the linux-lvm mailing list