xref: /freebsd/lib/geom/cache/gcache.8 (revision fa9896e082a1046ff4fbc75fcba4d18d1f2efc19)
1*e4b0a90eSBrooks Davis.\"-
2*e4b0a90eSBrooks Davis.\" Copyright (c) 2010 Edward Tomasz Napierala
3*e4b0a90eSBrooks Davis.\" All rights reserved.
4*e4b0a90eSBrooks Davis.\"
5*e4b0a90eSBrooks Davis.\" Redistribution and use in source and binary forms, with or without
6*e4b0a90eSBrooks Davis.\" modification, are permitted provided that the following conditions
7*e4b0a90eSBrooks Davis.\" are met:
8*e4b0a90eSBrooks Davis.\" 1. Redistributions of source code must retain the above copyright
9*e4b0a90eSBrooks Davis.\"    notice, this list of conditions and the following disclaimer.
10*e4b0a90eSBrooks Davis.\" 2. Redistributions in binary form must reproduce the above copyright
11*e4b0a90eSBrooks Davis.\"    notice, this list of conditions and the following disclaimer in the
12*e4b0a90eSBrooks Davis.\"    documentation and/or other materials provided with the distribution.
13*e4b0a90eSBrooks Davis.\"
14*e4b0a90eSBrooks Davis.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
15*e4b0a90eSBrooks Davis.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
16*e4b0a90eSBrooks Davis.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
17*e4b0a90eSBrooks Davis.\" ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
18*e4b0a90eSBrooks Davis.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
19*e4b0a90eSBrooks Davis.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
20*e4b0a90eSBrooks Davis.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
21*e4b0a90eSBrooks Davis.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
22*e4b0a90eSBrooks Davis.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
23*e4b0a90eSBrooks Davis.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
24*e4b0a90eSBrooks Davis.\" SUCH DAMAGE.
25*e4b0a90eSBrooks Davis.\"
26*e4b0a90eSBrooks Davis.Dd January 3, 2010
27*e4b0a90eSBrooks Davis.Dt GCACHE 8
28*e4b0a90eSBrooks Davis.Os
29*e4b0a90eSBrooks Davis.Sh NAME
30*e4b0a90eSBrooks Davis.Nm gcache
31*e4b0a90eSBrooks Davis.Nd "control utility for CACHE GEOM class"
32*e4b0a90eSBrooks Davis.Sh SYNOPSIS
33*e4b0a90eSBrooks Davis.Nm
34*e4b0a90eSBrooks Davis.Cm create
35*e4b0a90eSBrooks Davis.Op Fl v
36*e4b0a90eSBrooks Davis.Op Fl b Ar blocksize
37*e4b0a90eSBrooks Davis.Op Fl s Ar size
38*e4b0a90eSBrooks Davis.Ar name
39*e4b0a90eSBrooks Davis.Ar prov
40*e4b0a90eSBrooks Davis.Nm
41*e4b0a90eSBrooks Davis.Cm configure
42*e4b0a90eSBrooks Davis.Op Fl v
43*e4b0a90eSBrooks Davis.Op Fl b Ar blocksize
44*e4b0a90eSBrooks Davis.Op Fl s Ar size
45*e4b0a90eSBrooks Davis.Ar name
46*e4b0a90eSBrooks Davis.Nm
47*e4b0a90eSBrooks Davis.Cm destroy
48*e4b0a90eSBrooks Davis.Op Fl fv
49*e4b0a90eSBrooks Davis.Ar name
50*e4b0a90eSBrooks Davis.Nm
51*e4b0a90eSBrooks Davis.Cm label
52*e4b0a90eSBrooks Davis.Op Fl v
53*e4b0a90eSBrooks Davis.Op Fl b Ar blocksize
54*e4b0a90eSBrooks Davis.Op Fl s Ar size
55*e4b0a90eSBrooks Davis.Ar name
56*e4b0a90eSBrooks Davis.Ar prov
57*e4b0a90eSBrooks Davis.Nm
58*e4b0a90eSBrooks Davis.Cm stop
59*e4b0a90eSBrooks Davis.Op Fl fv
60*e4b0a90eSBrooks Davis.Ar name ...
61*e4b0a90eSBrooks Davis.Nm
62*e4b0a90eSBrooks Davis.Cm clear
63*e4b0a90eSBrooks Davis.Op Fl v
64*e4b0a90eSBrooks Davis.Ar prov ...
65*e4b0a90eSBrooks Davis.Nm
66*e4b0a90eSBrooks Davis.Cm dump
67*e4b0a90eSBrooks Davis.Ar prov ...
68*e4b0a90eSBrooks Davis.Nm
69*e4b0a90eSBrooks Davis.Cm list
70*e4b0a90eSBrooks Davis.Nm
71*e4b0a90eSBrooks Davis.Cm status
72*e4b0a90eSBrooks Davis.Op Fl s Ar name
73*e4b0a90eSBrooks Davis.Nm
74*e4b0a90eSBrooks Davis.Cm load
75*e4b0a90eSBrooks Davis.Op Fl v
76*e4b0a90eSBrooks Davis.Nm
77*e4b0a90eSBrooks Davis.Cm unload
78*e4b0a90eSBrooks Davis.Op Fl v
79*e4b0a90eSBrooks Davis.Sh DESCRIPTION
80*e4b0a90eSBrooks DavisThe
81*e4b0a90eSBrooks Davis.Nm
82*e4b0a90eSBrooks Davisutility is used to control GEOM cache, which can
83*e4b0a90eSBrooks Davisspeed up read performance by sending fixed size
84*e4b0a90eSBrooks Davisread requests to its consumer.  It has been developed to address
85*e4b0a90eSBrooks Davisthe problem of a horrible read performance of a 64k blocksize FS
86*e4b0a90eSBrooks Davisresiding on a RAID3 array with 8 data components, where a single
87*e4b0a90eSBrooks Davisdisk component would only get 8k read requests, thus effectively
88*e4b0a90eSBrooks Daviskilling disk performance under high load.
89*e4b0a90eSBrooks Davis.Pp
90*e4b0a90eSBrooks DavisCaching can be configured using two different methods:
91*e4b0a90eSBrooks Davis.Dq manual
92*e4b0a90eSBrooks Davisor
93*e4b0a90eSBrooks Davis.Dq automatic .
94*e4b0a90eSBrooks DavisWhen using the
95*e4b0a90eSBrooks Davis.Dq manual
96*e4b0a90eSBrooks Davismethod, no metadata are stored on the devices, so the cached
97*e4b0a90eSBrooks Davisdevice has to be configured by hand every time it is needed.
98*e4b0a90eSBrooks DavisThe
99*e4b0a90eSBrooks Davis.Dq automatic
100*e4b0a90eSBrooks Davismethod uses on-disk metadata to detect devices.
101*e4b0a90eSBrooks DavisOnce devices are labeled, they will be automatically detected and
102*e4b0a90eSBrooks Davisconfigured.
103*e4b0a90eSBrooks Davis.Pp
104*e4b0a90eSBrooks DavisThe first argument to
105*e4b0a90eSBrooks Davis.Nm
106*e4b0a90eSBrooks Davisindicates an action to be performed:
107*e4b0a90eSBrooks Davis.Bl -tag -width ".Cm destroy"
108*e4b0a90eSBrooks Davis.It Cm create
109*e4b0a90eSBrooks DavisCache the given devices with specified
110*e4b0a90eSBrooks Davis.Ar name .
111*e4b0a90eSBrooks DavisThis is the
112*e4b0a90eSBrooks Davis.Dq manual
113*e4b0a90eSBrooks Davismethod.
114*e4b0a90eSBrooks DavisThe kernel module
115*e4b0a90eSBrooks Davis.Pa geom_cache.ko
116*e4b0a90eSBrooks Daviswill be loaded if it is not loaded already.
117*e4b0a90eSBrooks Davis.It Cm label
118*e4b0a90eSBrooks DavisCache the given devices with the specified
119*e4b0a90eSBrooks Davis.Ar name .
120*e4b0a90eSBrooks DavisThis is the
121*e4b0a90eSBrooks Davis.Dq automatic
122*e4b0a90eSBrooks Davismethod, where metadata are stored in every device's last sector.
123*e4b0a90eSBrooks DavisThe kernel module
124*e4b0a90eSBrooks Davis.Pa geom_cache.ko
125*e4b0a90eSBrooks Daviswill be loaded if it is not loaded already.
126*e4b0a90eSBrooks Davis.It Cm stop
127*e4b0a90eSBrooks DavisTurn off existing cache device by its
128*e4b0a90eSBrooks Davis.Ar name .
129*e4b0a90eSBrooks DavisThis command does not touch on-disk metadata!
130*e4b0a90eSBrooks Davis.It Cm destroy
131*e4b0a90eSBrooks DavisSame as
132*e4b0a90eSBrooks Davis.Cm stop .
133*e4b0a90eSBrooks Davis.It Cm clear
134*e4b0a90eSBrooks DavisClear metadata on the given devices.
135*e4b0a90eSBrooks Davis.It Cm dump
136*e4b0a90eSBrooks DavisDump metadata stored on the given devices.
137*e4b0a90eSBrooks Davis.It Cm list
138*e4b0a90eSBrooks DavisSee
139*e4b0a90eSBrooks Davis.Xr geom 8 .
140*e4b0a90eSBrooks Davis.It Cm status
141*e4b0a90eSBrooks DavisSee
142*e4b0a90eSBrooks Davis.Xr geom 8 .
143*e4b0a90eSBrooks Davis.It Cm load
144*e4b0a90eSBrooks DavisSee
145*e4b0a90eSBrooks Davis.Xr geom 8 .
146*e4b0a90eSBrooks Davis.It Cm unload
147*e4b0a90eSBrooks DavisSee
148*e4b0a90eSBrooks Davis.Xr geom 8 .
149*e4b0a90eSBrooks Davis.El
150*e4b0a90eSBrooks Davis.Pp
151*e4b0a90eSBrooks DavisAdditional options:
152*e4b0a90eSBrooks Davis.Bl -tag -width indent
153*e4b0a90eSBrooks Davis.It Fl f
154*e4b0a90eSBrooks DavisForce the removal of the specified cache device.
155*e4b0a90eSBrooks Davis.It Fl v
156*e4b0a90eSBrooks DavisBe more verbose.
157*e4b0a90eSBrooks Davis.El
158*e4b0a90eSBrooks Davis.Sh SYSCTL VARIABLES
159*e4b0a90eSBrooks DavisThe following
160*e4b0a90eSBrooks Davis.Xr sysctl 8
161*e4b0a90eSBrooks Davisvariables can be used to control the behavior of the
162*e4b0a90eSBrooks Davis.Nm CACHE
163*e4b0a90eSBrooks DavisGEOM class.
164*e4b0a90eSBrooks DavisThe default value is shown next to each variable.
165*e4b0a90eSBrooks Davis.Bl -tag -width indent
166*e4b0a90eSBrooks Davis.It Va kern.geom.cache.used_hi : No 20
167*e4b0a90eSBrooks Davis.It Va kern.geom.cache.used_lo : No 5
168*e4b0a90eSBrooks Davis.It Va kern.geom.cache.idletime : No 5
169*e4b0a90eSBrooks Davis.It Va kern.geom.cache.timeout : No 10
170*e4b0a90eSBrooks Davis.It Va kern.geom.cache.enable : No 1
171*e4b0a90eSBrooks Davis.It Va kern.geom.cache.debug : No 0
172*e4b0a90eSBrooks DavisDebug level of the
173*e4b0a90eSBrooks Davis.Nm CACHE
174*e4b0a90eSBrooks DavisGEOM class.
175*e4b0a90eSBrooks DavisThis can be set to a number between 0 and 3 inclusive.
176*e4b0a90eSBrooks DavisIf set to 0 minimal debug information is printed, and if set to 3 the
177*e4b0a90eSBrooks Davismaximum amount of debug information is printed.
178*e4b0a90eSBrooks Davis.El
179*e4b0a90eSBrooks Davis.Sh EXIT STATUS
180*e4b0a90eSBrooks DavisExit status is 0 on success, and 1 if the command fails.
181*e4b0a90eSBrooks Davis.Sh SEE ALSO
182*e4b0a90eSBrooks Davis.Xr geom 4 ,
183*e4b0a90eSBrooks Davis.Xr geom 8
184*e4b0a90eSBrooks Davis.Sh HISTORY
185*e4b0a90eSBrooks DavisThe
186*e4b0a90eSBrooks Davis.Nm
187*e4b0a90eSBrooks Davisutility appeared in
188*e4b0a90eSBrooks Davis.Fx 7.0 .
189*e4b0a90eSBrooks Davis.Sh AUTHORS
190*e4b0a90eSBrooks Davis.An Ruslan Ermilov Aq Mt ru@FreeBSD.org
191