searchfs

Moderators: jhartley, MSR734, nola

searchfs

Post by grahamperrin » Thu Nov 14, 2013 7:34 am

At viewtopic.php?p=4341#p4341

… in my OS X 10.8.3 environment, active searchfs jobs are noticeable only after a forced stop or forced restart of the Mac, or after a kernel panic.

I allow indexing of all ZFS file systems, including children, and I don't find indexing disruptive. YMMV


A little more detail:

  1. a searchfs job of, say, my large ZFS home directory may be time-consuming – and be disruptive (a negative impact on performance of the Mac)
  2. during that time, the Spotlight menu shows indexing of the computer
  3. for a file system where there's a searchfs job, I guess that mds-related processes don't (can't) get started until after completion of the the searchfs job – I never find mds-related indexing disruptive.

Examples

Early this morning, 04:22, if I recall correctly this was after dynamic import of a pool where previously I had inadvertently disabled indexing of child file systems:

Code: Select all
____________________________________________________________________________
    FILES     DIRS   XATTRS  MATCHES     TIME     DONE/RATE
     1019       14        0      513     0:12    99.5% (1329)  S-184467435278423
     1019       14        0     1032     0:11    99.5% (1329)  S-184467435278493
     1019       13        0        0     0:09    99.4% (1329)  S-184467435278516
     7654     2161      116       19     0:08    1.30% (1329)  S-184467435278662
____________________________________________________________________________


Context:

Code: Select all
gpes3e-gjp4:~ gjp22$ zstat

 v2012.09.23    197 threads        8 mounts       22383 vnodes     04:22:58
____________________________________________________________________________
             KALLOC      KERNEL/MAPS        TOTAL         EQUITY
  WIRED      53 MiB    1851 MiB/1876         1904 MiB      23.25%
  PEAK      134 MiB    2850 MiB              2984 MiB
  VMPAGE      12167 (IN)       5372 (OUT)       5347 (SYNC)        171 (MDS)
____________________________________________________________________________
                     HITS                  MISSES
  ARC overall:        97% (94821432)           3% (2237363)
  ARC demand data:    98% (42602991)           2% (576041)
  ARC demand meta:    97% (52196651)           3% (1331536)
  ARC prefetch data:   1% (6120)              99% (302840)
  ARC prefetch meta:  36% (15670)             64% (26946)
____________________________________________________________________________
     SIZE     SLAB    AVAIL    INUSE    TOTAL     PEAK  KMEM CACHE NAME
       72     4096    24399    30656    55055    69575  kmem_slab_cache
       24     4096   152560   249576   402136   454240  kmem_bufctl_cache
       88     4096       30     2085     2115     8055  taskq_ent_cache
      360     4096        0       55       55       55  taskq_cache
      824     8192        5       13       18    11727  zio_cache
       48     4096       76        7       83    11786  zio_link_cache
       80     4096    31767    22383    54150    79950  sa_cache
      840     8192     5783    46957    52740   132678  dnode_t
      216     4096    42822    73170   115992   189504  dmu_buf_impl_t
      200     4096   101618    54362   155980   206380  arc_buf_hdr_t
      104     4096    20065    36783    56848   119168  arc_buf_t
      192     4096       37        3       40      200  zil_lwb_cache
      400     4096    13807    22383    36190    79910  znode_t
      512     8192    32459    44965    77424   141984  zio_buf_512
     1024     8192        2      686      688     1792  zio_buf_1024
     1536    12288        4      180      184     3144  zio_buf_1536
     2048     8192        0      264      264      844  zio_buf_2048
     2560    20480        3       53       56     1824  zio_buf_2560
     3072    12288        3       33       36     7932  zio_buf_3072
     3584   114688       22       42       64     4224  zio_buf_3584
     4096     8192        0    16416    16416    49012  zio_buf_4096
     5120    20480        5       31       36      708  zio_buf_5120
     6144    12288        0       26       26      440  zio_buf_6144
     7168   114688        6       42       48      304  zio_buf_7168
     8192     8192        0       17       17      590  zio_buf_8192
    10240    20480        1       33       34      270  zio_buf_10240
    12288    12288        0       18       18      264  zio_buf_12288
    14336   114688        6       10       16      184  zio_buf_14336
    16384    65536     5764     9536    15300    41856  zio_buf_16384
    20480    20480        0       19       19      289  zio_buf_20480
    24576    98304        0       20       20      216  zio_buf_24576
    28672   114688        2       46       48      244  zio_buf_28672
    32768    65536        1       19       20      224  zio_buf_32768
    36864   262144        1       13       14      168  zio_buf_36864
    40960   131072        3        9       12      189  zio_buf_40960
    45056    65536        0       11       11      178  zio_buf_45056
    49152    98304        1       19       20      246  zio_buf_49152
    53248    65536        0       15       15      196  zio_buf_53248
    57344   114688        2       32       34      296  zio_buf_57344
    61440   131072        1        9       10      262  zio_buf_61440
    65536    65536        0       17       17      203  zio_buf_65536
    69632    98304        0        9        9      288  zio_buf_69632
    73728    98304        0        6        6      209  zio_buf_73728
    77824   262144        2        4        6      162  zio_buf_77824
    81920   262144        6        3        9      198  zio_buf_81920
    86016   262144        1        5        6      477  zio_buf_86016
    90112    98304        0        5        5      217  zio_buf_90112
    94208    98304        0        2        2      191  zio_buf_94208
    98304    98304        0        2        2      184  zio_buf_98304
   102400   131072        0        2        2      169  zio_buf_102400
   106496   114688        0        4        4      200  zio_buf_106496
   110592   131072        0        4        4      193  zio_buf_110592
   114688   114688        0        5        5      171  zio_buf_114688
   118784   131072        0        6        6       27  zio_buf_118784
   122880   131072        0        6        6       30  zio_buf_122880
   126976   131072        0        5        5       36  zio_buf_126976
   131072   131072        0     5616     5616    16396  zio_buf_131072
____________________________________________________________________________
    FILES     DIRS   XATTRS  MATCHES     TIME     DONE/RATE
     1019       14        0      513     0:12    99.5% (1329)  S-184467435278423
     1019       14        0     1032     0:11    99.5% (1329)  S-184467435278493
     1019       13        0        0     0:09    99.4% (1329)  S-184467435278516
     7654     2161      116       19     0:08    1.30% (1329)  S-184467435278662
____________________________________________________________________________


An unrelated kernel panic some time after 08:10 then not immediately afterwards, but some time after I arrived at work:

Code: Select all
____________________________________________________________________________
    FILES     DIRS   XATTRS  MATCHES     TIME     DONE/RATE
    10239      546     3952       33     0:54    0.29% (310)  S-1844674352754042
____________________________________________________________________________


Context:

Code: Select all
gpes3e-gjp4:~ gjp22$ zstat

 v2012.09.23    224 threads        4 mounts        8821 vnodes     09:41:09
____________________________________________________________________________
             KALLOC      KERNEL/MAPS        TOTAL         EQUITY
  WIRED     135 MiB    2285 MiB/2299         2421 MiB      29.56%
  PEAK      138 MiB    2285 MiB              2424 MiB
  VMPAGE       1825 (IN)         99 (OUT)         88 (SYNC)          0 (MDS)
____________________________________________________________________________
                     HITS                  MISSES
  ARC overall:        96% (4407027)            4% (171873)
  ARC demand data:    92% (1131335)            8% (89957)
  ARC demand meta:    97% (3274409)            3% (80255)
  ARC prefetch meta:  43% (1283)              57% (1659)
  DMU zfetch:         89% (5966)              11% (664)
____________________________________________________________________________
     SIZE     SLAB    AVAIL    INUSE    TOTAL     PEAK  KMEM CACHE NAME
       72     4096       68   100582   100650   100650  kmem_slab_cache
       24     4096      249   453824   454073   454073  kmem_bufctl_cache
       88     4096      158     1597     1755     2340  taskq_ent_cache
      360     4096        8       36       44       44  taskq_cache
      824     8192       10      260      270     1863  zio_cache
       48     4096       50      282      332     1909  zio_link_cache
       80     4096    17431     8819    26250    31950  sa_cache
      840     8192        9    73521    73530    73530  dnode_t
      216     4096       78   243426   243504   243504  dmu_buf_impl_t
      200     4096        9   210651   210660   210660  arc_buf_hdr_t
      104     4096      913   175331   176244   176244  arc_buf_t
      192     4096       13        7       20      160  zil_lwb_cache
      400     4096     9699     8821    18520    31950  znode_t
       40     4096       99        1      100      200  zpl_dirlock
      512     8192        6    77306    77312    77488  zio_buf_512
     1024     8192      235     1221     1456     1560  zio_buf_1024
     1536    12288       94      610      704      768  zio_buf_1536
     2048     8192       50      434      484      524  zio_buf_2048
     2560    20480       22      242      264      296  zio_buf_2560
     3072    12288        5      175      180      188  zio_buf_3072
     3584   114688       31      129      160      160  zio_buf_3584
     4096     8192        2   141010   141012   141346  zio_buf_4096
     5120    20480       11      165      176      176  zio_buf_5120
     6144    12288        0      114      114      118  zio_buf_6144
     7168   114688        9      119      128      128  zio_buf_7168
     8192     8192        0      117      117      166  zio_buf_8192
    10240    20480        1      365      366      366  zio_buf_10240
    12288    12288        0       92       92       99  zio_buf_12288
    14336   114688        3      229      232      232  zio_buf_14336
    16384    65536     1767    15061    16828    18284  zio_buf_16384
    20480    20480        0      112      112      115  zio_buf_20480
    24576    98304        0       72       72       76  zio_buf_24576
    28672   114688        3       61       64       76  zio_buf_28672
    32768    65536        2       56       58       86  zio_buf_32768
    36864   262144        1       34       35       42  zio_buf_36864
    40960   131072        0       63       63       78  zio_buf_40960
    45056    65536        0       21       21       36  zio_buf_45056
    49152    98304        1       57       58       72  zio_buf_49152
    53248    65536        0       46       46       70  zio_buf_53248
    57344   114688        8      210      218      296  zio_buf_57344
    61440   131072        0       32       32       32  zio_buf_61440
    65536    65536        0       23       23       25  zio_buf_65536
    69632    98304        0       23       23       28  zio_buf_69632
    73728    98304        0       18       18       26  zio_buf_73728
    77824   262144        0       12       12       21  zio_buf_77824
    81920   262144        1       23       24       27  zio_buf_81920
    86016   262144        4       20       24       27  zio_buf_86016
    90112    98304        0       17       17       19  zio_buf_90112
    94208    98304        0       26       26       30  zio_buf_94208
    98304    98304        0       16       16       20  zio_buf_98304
   102400   131072        0       13       13       17  zio_buf_102400
   106496   114688        0       13       13       18  zio_buf_106496
   110592   131072        0       18       18       21  zio_buf_110592
   114688   114688        0       15       15       17  zio_buf_114688
   118784   131072        0       13       13       14  zio_buf_118784
   122880   131072        0       10       10       11  zio_buf_122880
   126976   131072        0        7        7       10  zio_buf_126976
   131072   131072        0     8902     8902     9106  zio_buf_131072
____________________________________________________________________________
    FILES     DIRS   XATTRS  MATCHES     TIME     DONE/RATE
    10239      546     3952       33     0:54    0.29% (310)  S-1844674352754042
____________________________________________________________________________


A few hours later:

Code: Select all
____________________________________________________________________________
    FILES     DIRS   XATTRS  MATCHES     TIME     DONE/RATE
  1975525   215481  2821130     1745   127:15    100.0% (1042)  S-18446743527540
____________________________________________________________________________


Context:

Code: Select all
gpes3e-gjp4:~ gjp22$ zstat

 v2012.09.23    172 threads        4 mounts       10473 vnodes     11:47:30
____________________________________________________________________________
             KALLOC      KERNEL/MAPS        TOTAL         EQUITY
  WIRED     143 MiB    2844 MiB/2858         2988 MiB      36.48%
  PEAK      150 MiB    2888 MiB              3039 MiB
  VMPAGE       8091 (IN)        318 (OUT)        289 (SYNC)          0 (MDS)
____________________________________________________________________________
                     HITS                  MISSES
  ARC overall:        95% (28474939)           5% (1218932)
  ARC demand data:    99% (15537761)           1% (104744)
  ARC demand meta:    93% (12935289)           7% (866516)
  ARC prefetch meta:   0% (1889)             100% (247670)
  DMU zfetch:         89% (5966)              11% (664)
____________________________________________________________________________
     SIZE     SLAB    AVAIL    INUSE    TOTAL     PEAK  KMEM CACHE NAME
       72     4096    47126    64029   111155   114400  kmem_slab_cache
       24     4096    91201   515176   606377   641113  kmem_bufctl_cache
       88     4096      120     1545     1665     2340  taskq_ent_cache
      360     4096        8       36       44       44  taskq_cache
      824     8192        5       22       27     1863  zio_cache
       48     4096       66       17       83     1909  zio_link_cache
       80     4096     5886    10464    16350    31950  sa_cache
      840     8192        3   142701   142704   175122  dnode_t
      216     4096    24482   206944   231426   324288  dmu_buf_impl_t
      200     4096     2689   193911   196600   258540  arc_buf_hdr_t
      104     4096    57996    73408   131404   180614  arc_buf_t
      192     4096       14        6       20      160  zil_lwb_cache
      400     4096     4917    10473    15390    31950  znode_t
      512     8192     7219   142941   150160   173968  zio_buf_512
     1024     8192       87      617      704     1560  zio_buf_1024
     1536    12288      145      255      400      768  zio_buf_1536
     2048     8192       62      138      200      604  zio_buf_2048
     2560    20480       74      158      232      296  zio_buf_2560
     3072    12288       28       48       76      196  zio_buf_3072
     3584   114688      102       26      128      160  zio_buf_3584
     4096     8192      373    34577    34950   142258  zio_buf_4096
     5120    20480       16       80       96      192  zio_buf_5120
     6144    12288        2       42       44      126  zio_buf_6144
     7168   114688        6       90       96      128  zio_buf_7168
     8192     8192        0       60       60      166  zio_buf_8192
    10240    20480        0      294      294      476  zio_buf_10240
    12288    12288        0       43       43      110  zio_buf_12288
    14336   114688       15      377      392      448  zio_buf_14336
    16384    65536      994    19614    20608    21696  zio_buf_16384
    20480    20480        0       83       83      142  zio_buf_20480
    24576    98304        2       98      100      104  zio_buf_24576
    28672   114688        4       96      100      104  zio_buf_28672
    32768    65536        0       92       92      102  zio_buf_32768
    36864   262144        4       45       49       56  zio_buf_36864
    40960   131072        2       58       60       90  zio_buf_40960
    45056    65536        0       38       38       46  zio_buf_45056
    49152    98304        1       67       68       86  zio_buf_49152
    53248    65536        0       67       67       83  zio_buf_53248
    57344   114688       14       72       86      296  zio_buf_57344
    61440   131072        1       65       66       76  zio_buf_61440
    65536    65536        0       57       57       97  zio_buf_65536
    69632    98304        0       53       53       56  zio_buf_69632
    73728    98304        0       62       62       68  zio_buf_73728
    77824   262144        1       56       57       66  zio_buf_77824
    81920   262144        2       40       42       57  zio_buf_81920
    86016   262144        2       52       54       60  zio_buf_86016
    90112    98304        0       30       30       40  zio_buf_90112
    94208    98304        0       19       19       33  zio_buf_94208
    98304    98304        0       24       24       33  zio_buf_98304
   102400   131072        0       19       19       27  zio_buf_102400
   106496   114688        0       15       15       24  zio_buf_106496
   110592   131072        0       11       11       25  zio_buf_110592
   114688   114688        0       18       18       24  zio_buf_114688
   118784   131072        0       17       17       23  zio_buf_118784
   122880   131072        0       10       10       14  zio_buf_122880
   126976   131072        0       18       18       23  zio_buf_126976
   131072   131072        0    11906    11906    12551  zio_buf_131072
____________________________________________________________________________
    FILES     DIRS   XATTRS  MATCHES     TIME     DONE/RATE
  1975525   215481  2821130     1745   127:15    100.0% (1042)  S-18446743527540
____________________________________________________________________________


Related

MacZFS Issue 65: Implement searchfs (2010-12-23)

Counts at the foot of output from zstat (2012-12-16)

Search with FileBuddy and Spotlight (2013-05-09)

mds kernel panic, _zfsx_searchfs, _zfsx_search_harvest (2013-10-23)

Value of searchfs

Notes to follow …
grahamperrin Offline

User avatar
 
Posts: 1596
Joined: Fri Sep 14, 2012 10:21 pm
Location: Brighton and Hove, United Kingdom

searchfs: abbreviation of job names

Post by grahamperrin » Thu Nov 14, 2013 11:34 am

After posting the examples above I realised that an 80-column window may be too narrow; job names become abbreviated.

For example, with 90 columns:

Code: Select all
… 
 v2012.09.23    190 threads        8 mounts       18870 vnodes     16:22:48

____________________________________________________________________________
    FILES     DIRS   XATTRS  MATCHES     TIME     DONE/RATE
   549310   126312    41800       53     5:52    94.2% (2271)  S-18446743527558253568
____________________________________________________________________________


… then 80:

Code: Select all

 v2012.09.23    190 threads        8 mounts       18862 vnodes     16:23:05

____________________________________________________________________________
    FILES     DIRS   XATTRS  MATCHES     TIME     DONE/RATE
   578606   126772    42894       66     6:09    98.2% (2258)  S-184467435275582
____________________________________________________________________________


… then again 90:

Code: Select all
… 
 v2012.09.23    313 threads        8 mounts       20216 vnodes     16:23:31

____________________________________________________________________________
    FILES     DIRS   XATTRS  MATCHES     TIME     DONE/RATE
   590799   127060    43839      277     6:35    100.0% (2148)  S-18446743527558253568
    16741     4940      308    21660     0:18    2.89% (1265)  S-18446743527556910080
____________________________________________________________________________
grahamperrin Offline

User avatar
 
Posts: 1596
Joined: Fri Sep 14, 2012 10:21 pm
Location: Brighton and Hove, United Kingdom

Value of searchfs

Post by grahamperrin » Thu Nov 14, 2013 12:16 pm

searchfs (sometimes known as search-fs) is:


Elsewhere I read "Spotlight uses this API, so if your file system does not support it, no searching. …" but I'm not sure of that equation, because in a summer alpha test of ZFS-OSX, I'm almost certain that I found Spotlight partially working – presumably without searchfs.

Points below are adapted from an e-mail from a few months ago …

searchfs()

I found two apps that probably use the function:


For the latter there's something in OpenRadar:


A little more context at the following pages:

grahamperrin Offline

User avatar
 
Posts: 1596
Joined: Fri Sep 14, 2012 10:21 pm
Location: Brighton and Hove, United Kingdom

Things that might trigger searchfs jobs

Post by grahamperrin » Thu Nov 14, 2013 4:15 pm

I'm fairly sure that in some situations, find(1) can be a trigger.

The two screenshots at https://www.wuala.com/grahamperrin/public/2013/11/14/b/ show a short job that began shortly after I ran find(1) in part of a recently mounted backup of my ZFS home directory.

In both shots – during and after the searchfs job – there's the indication of activity in the Spotlight menu.
grahamperrin Offline

User avatar
 
Posts: 1596
Joined: Fri Sep 14, 2012 10:21 pm
Location: Brighton and Hove, United Kingdom


Return to General Discussion

Who is online

Users browsing this forum: ilovezfs and 0 guests

cron