Оптимизация производительности. Часть 3. Еще инструменты.

Но кроме “встроенных” в Data ONTAP средств, есть еще и очень полезные “внешние” утилиты сбора и анализа. Например, для пользователей NetApp на NOW есть скрипт perfstat, собирающий с контроллера разнообразную информацию по производительности в единый “лист”. В дальнейшем этот вывод perfstat можно обрабатывать и анализировать другими утилитами, а также использовать в сайзинге.

Скрипт существует как для UNIX (в виде bash-скрипта), так и для Windows, оба варианта работают через rsh/ssh.
Запущенный без параметров, он выведет подробную инструкцию по использованию. Рекомендую начать с ее изучения.

Perfstat: Version 7.32 12-2008
    - perfstat.sh is a simple Bourne Shell script that
      captures performance and configuration statistics.
    - Output from perfstat is sent to standard out and
      is typically captured in an output file for
      later analysis.
    - perfstat.sh is capable of capturing info from host(s) and
      NetApp storage controllers simultaneously.
    - Currently perfstat supports these OS platforms:
      Solaris, HP-UX, OSF1, Linux, AIX, FreeBSD, OpenBSD, ESX 3.5
    - perfstat.sh is typically run as root from the host or
      as a user with root-level permissions
    - For controller data capture, the user must have RSH or
      SSH privileges to the controller. Unless instructed otherwise,
      perfstat will use 'root' as the default username to communicate
      remotely with storage controllers and hosts.
Usage: (basic options list)
 perfstat [-f controllername] [-t time] > perfstat.out
    where:
    -f controllername - host name (or IP address) of target controller
    -t time - collect performance data for 'time' minutes

 Simple Examples:
   Capture data on local host and one controller for 5 minutes:
     perfstat -f controller1 -t 5 > perfstat.out
   Capture data on multiple hosts and controllers for 10 minutes:
     perfstat -h host1,host2 -f controller1,controller2 -t 10 > perfstat.out
   Capture data for five 1 minute iterations, with 10 minutes between
   successive iterations:
     perfstat -f controller1 -t 1 -i 5,10 > perfstat.out

Usage: (more complete options list)
 perfstat
          [-f controllername[,controllername1,controllername2,...]]
          [-h hostname[,hostname1,hostname2,...]]
          [-t time] (sample time per iteration, default 2)
          [-i n[,m]] (repeat n times with m minutes between samples,
                      defaults: n=1, m=0)
          [-I] (force perfstat to execute all iterations)

          [-r rootcmd] (e.g. sudo)
          [-l login[:password]] (RSH/SSH login and RSH password)
          [-S] (use SSH instead of RSH)
          [-s param1[,value1][:param2[,value2]]...] (optional RSH/SSH
                                                     arguments)

          [-F] (do not capture information from local host)
          [-V] (do not capture vfiler data)
          [-p] (capture performance data only, no config info)
          [-c] (capture config info only, no performance data)
          [-L] (capture logs - beware verbose output)
          [-E cmd[,cmd2,cmd3] (exclude commands)
          [-P domain1[,domain2,domain3...] (capture profiles,
              use "-P flat" to capture complete profile)

          [-a app_name -o app_param] (E.g., -a oracle)

          [-v] (print version info only)
          [-q] (quiet mode - suppress all console output)
          [-x] (print what commands will be issued without actually
                issuing them)
          [-d] (debug mode - beware verbose output)

          [-b] (begin sampling and return immediately)
          [-e] (end sampling - used in conjunction with -b)

          [-n] (RAM Service Invocation)

          [-k] (disable collection of "stutter" statit; i.e.,
                collect 1 statit report that covers the entire
                iteration)
          [-K] (collect only "stutter" statit reports over
                the entire iteration)

          [-T default | sk_mod,level[,sk_mod2,level,...]] (collect sktrace)
          [-B sk_buffer_size] (specify sktrace buffer size)

Notes:
 -h option adds hosts to be monitored.  By default, the local
    host is always monitored, unless the -F flag is specified.
    E.g., executing this command
      perfstat -h host1 > perfstat.out
    on machine host0 will result in data captured from both
    host0 and host1
    This command:
      perfstat -F -h host1 > perfstat.out
    on machine host0 will result in data captured from host1 only
 -l option is only applied to RSH/SSH commands to the controller.
    RSH/SSH commands to other hosts do not use the -l information.
    perfstat.sh does not support password authentication over SSH,
    so if '-S -l login:password' is specified, the password will
    be stripped from the subsequent SSH invocations.
 -S requires passwordless (public key) SSH authentication to be
    configured for all controllers and hosts
    An SSH username may prefix a hostname using a '@'
    E.g.,
      perfstat -S -h root@host1,user@host2
    Additionally, the -l option can be used to specify usernames for
    controller login. E.g.,
      perfstat -S -f controllername -l user
 -s arguments to this option use the syntax 'param,value', and param
    value pairs can be separated by a ':'
    E.g. the syntax '-S -s p1,22:p2:p3,v3' tells perfstat to build
    the following SSH invocation string:
     'SSH -o BatchMode=yes -2 -ax -p1 22 -p2 -p3 v3'
 -a is limited to these applications currently:
    oracle: -o specifies sub arguments.  run -o help for details
 -b|-e are provided for legacy compatibility and can be used to
    manually perform an iteration. Use -b to start the iteration
    and after perfstat returns, use -e to stop that iteration.
 -P saves profiling data in a tar.gz file in the current working
    directory and deletes any existing gmon files on the controller
 -E excludes all foreground commands that have at least the cmd as a
    substring; E.g.
      -E snap,vol       - excludes all 'snap*' and 'vol*' commands
      -E "snap list -v" - excludes only the command 'snap list -v'
 -T used to toggle sktrace collection and specify sk modules and the
    levels at which trace data should be collected for those modules.
    Some valid sk modules include SK, WAFL, DISK and SCSITARGET. For
    default values of 'SK 7 WAFL 4', specify '-T default'. sktrace data
    will be copied off of the controller(s) and into the current working
    directory from where perfstat was invoked.
 -B used to manually set the sktrace buffer size. By default, perfstat
    will use a default value of '40m' (40MB). Please note that it is
    required that the units be specified with the size in the format:
    k (KB), m (MB), or g (GB). This value should only be changed if
    specifically advised by global support.
 Early termination of execution: as of v7.00 perfstat will terminate
   iterations early if a calculated max runtime is met or exceeded.
   If it is required that perfstat must execute all iterations regardless
   of the total runtime, please use the '-I' option.

Неплохим вариантом использования будет сбор “суточной” статистики, путем регулярного запуска perfstat, и сбора данных, например, каждые полчаса.

Например, можно поместить в cron на администраторском хосте команду вида:

perfstat -f filer1 -t 30 -i 46 > perfstat.$date.out

Такая строка запуска делает 46 “снимков” с 30-минутным интервалом, что покрывает примерно 23 часа суток. ??з-за некоторых сложностей, связанных с тем, что выполнение множества команд в rsh при выполнении скрипта может подтормаживать, и за сутки может набежать довольно существенная задержка, NetApp рекомендует делать полный интервал снятия показаний не 24, а 23 часа (46 снимков каждые полчаса), оставив запас между сутками в час,  чтобы быть уверенным, что из-за таких задержек исполнения, не набежит нежелательная погрешность для времени запуска.

Так как официально perfstat раздается только с NOW, то есть действующим пользователям NetApp, наверное я вам его раздавать не буду, сами скачайте с NOW.

Для обработки вывода perfstat можо воспользоваться интересной утилитой PerfViewer.

Она представляет собой несколько java-апплетов, визуализирующих вывод perfstat, и поможет быстро проанализировать и оценить данные, собранные им.

Берут там же. :)

Комментарии (2)

  1. Dmitry Gorokhov:

    Роман, что-то не вижу на now PerfViewer. Не могли бы вы ссылочкой в почту поделиться?

    Спасибо.

  2. Альберт Салман:

    Его там не было никогда. Я его нашел на Field Portal когда-то (fieldportal.netapp.com).

Оставить комментарий