xref: /freebsd/lib/geom/cache/gcache.8 (revision e4b0a90e771b94e4b043729a6f0f5564f1d01aca)
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.\" $FreeBSD$
27*e4b0a90eSBrooks Davis.\"
28*e4b0a90eSBrooks Davis.Dd January 3, 2010
29*e4b0a90eSBrooks Davis.Dt GCACHE 8
30*e4b0a90eSBrooks Davis.Os
31*e4b0a90eSBrooks Davis.Sh NAME
32*e4b0a90eSBrooks Davis.Nm gcache
33*e4b0a90eSBrooks Davis.Nd "control utility for CACHE GEOM class"
34*e4b0a90eSBrooks Davis.Sh SYNOPSIS
35*e4b0a90eSBrooks Davis.Nm
36*e4b0a90eSBrooks Davis.Cm create
37*e4b0a90eSBrooks Davis.Op Fl v
38*e4b0a90eSBrooks Davis.Op Fl b Ar blocksize
39*e4b0a90eSBrooks Davis.Op Fl s Ar size
40*e4b0a90eSBrooks Davis.Ar name
41*e4b0a90eSBrooks Davis.Ar prov
42*e4b0a90eSBrooks Davis.Nm
43*e4b0a90eSBrooks Davis.Cm configure
44*e4b0a90eSBrooks Davis.Op Fl v
45*e4b0a90eSBrooks Davis.Op Fl b Ar blocksize
46*e4b0a90eSBrooks Davis.Op Fl s Ar size
47*e4b0a90eSBrooks Davis.Ar name
48*e4b0a90eSBrooks Davis.Nm
49*e4b0a90eSBrooks Davis.Cm destroy
50*e4b0a90eSBrooks Davis.Op Fl fv
51*e4b0a90eSBrooks Davis.Ar name
52*e4b0a90eSBrooks Davis.Nm
53*e4b0a90eSBrooks Davis.Cm label
54*e4b0a90eSBrooks Davis.Op Fl v
55*e4b0a90eSBrooks Davis.Op Fl b Ar blocksize
56*e4b0a90eSBrooks Davis.Op Fl s Ar size
57*e4b0a90eSBrooks Davis.Ar name
58*e4b0a90eSBrooks Davis.Ar prov
59*e4b0a90eSBrooks Davis.Nm
60*e4b0a90eSBrooks Davis.Cm stop
61*e4b0a90eSBrooks Davis.Op Fl fv
62*e4b0a90eSBrooks Davis.Ar name ...
63*e4b0a90eSBrooks Davis.Nm
64*e4b0a90eSBrooks Davis.Cm clear
65*e4b0a90eSBrooks Davis.Op Fl v
66*e4b0a90eSBrooks Davis.Ar prov ...
67*e4b0a90eSBrooks Davis.Nm
68*e4b0a90eSBrooks Davis.Cm dump
69*e4b0a90eSBrooks Davis.Ar prov ...
70*e4b0a90eSBrooks Davis.Nm
71*e4b0a90eSBrooks Davis.Cm list
72*e4b0a90eSBrooks Davis.Nm
73*e4b0a90eSBrooks Davis.Cm status
74*e4b0a90eSBrooks Davis.Op Fl s Ar name
75*e4b0a90eSBrooks Davis.Nm
76*e4b0a90eSBrooks Davis.Cm load
77*e4b0a90eSBrooks Davis.Op Fl v
78*e4b0a90eSBrooks Davis.Nm
79*e4b0a90eSBrooks Davis.Cm unload
80*e4b0a90eSBrooks Davis.Op Fl v
81*e4b0a90eSBrooks Davis.Sh DESCRIPTION
82*e4b0a90eSBrooks DavisThe
83*e4b0a90eSBrooks Davis.Nm
84*e4b0a90eSBrooks Davisutility is used to control GEOM cache, which can
85*e4b0a90eSBrooks Davisspeed up read performance by sending fixed size
86*e4b0a90eSBrooks Davisread requests to its consumer.  It has been developed to address
87*e4b0a90eSBrooks Davisthe problem of a horrible read performance of a 64k blocksize FS
88*e4b0a90eSBrooks Davisresiding on a RAID3 array with 8 data components, where a single
89*e4b0a90eSBrooks Davisdisk component would only get 8k read requests, thus effectively
90*e4b0a90eSBrooks Daviskilling disk performance under high load.
91*e4b0a90eSBrooks Davis.Pp
92*e4b0a90eSBrooks DavisCaching can be configured using two different methods:
93*e4b0a90eSBrooks Davis.Dq manual
94*e4b0a90eSBrooks Davisor
95*e4b0a90eSBrooks Davis.Dq automatic .
96*e4b0a90eSBrooks DavisWhen using the
97*e4b0a90eSBrooks Davis.Dq manual
98*e4b0a90eSBrooks Davismethod, no metadata are stored on the devices, so the cached
99*e4b0a90eSBrooks Davisdevice has to be configured by hand every time it is needed.
100*e4b0a90eSBrooks DavisThe
101*e4b0a90eSBrooks Davis.Dq automatic
102*e4b0a90eSBrooks Davismethod uses on-disk metadata to detect devices.
103*e4b0a90eSBrooks DavisOnce devices are labeled, they will be automatically detected and
104*e4b0a90eSBrooks Davisconfigured.
105*e4b0a90eSBrooks Davis.Pp
106*e4b0a90eSBrooks DavisThe first argument to
107*e4b0a90eSBrooks Davis.Nm
108*e4b0a90eSBrooks Davisindicates an action to be performed:
109*e4b0a90eSBrooks Davis.Bl -tag -width ".Cm destroy"
110*e4b0a90eSBrooks Davis.It Cm create
111*e4b0a90eSBrooks DavisCache the given devices with specified
112*e4b0a90eSBrooks Davis.Ar name .
113*e4b0a90eSBrooks DavisThis is the
114*e4b0a90eSBrooks Davis.Dq manual
115*e4b0a90eSBrooks Davismethod.
116*e4b0a90eSBrooks DavisThe kernel module
117*e4b0a90eSBrooks Davis.Pa geom_cache.ko
118*e4b0a90eSBrooks Daviswill be loaded if it is not loaded already.
119*e4b0a90eSBrooks Davis.It Cm label
120*e4b0a90eSBrooks DavisCache the given devices with the specified
121*e4b0a90eSBrooks Davis.Ar name .
122*e4b0a90eSBrooks DavisThis is the
123*e4b0a90eSBrooks Davis.Dq automatic
124*e4b0a90eSBrooks Davismethod, where metadata are stored in every device's last sector.
125*e4b0a90eSBrooks DavisThe kernel module
126*e4b0a90eSBrooks Davis.Pa geom_cache.ko
127*e4b0a90eSBrooks Daviswill be loaded if it is not loaded already.
128*e4b0a90eSBrooks Davis.It Cm stop
129*e4b0a90eSBrooks DavisTurn off existing cache device by its
130*e4b0a90eSBrooks Davis.Ar name .
131*e4b0a90eSBrooks DavisThis command does not touch on-disk metadata!
132*e4b0a90eSBrooks Davis.It Cm destroy
133*e4b0a90eSBrooks DavisSame as
134*e4b0a90eSBrooks Davis.Cm stop .
135*e4b0a90eSBrooks Davis.It Cm clear
136*e4b0a90eSBrooks DavisClear metadata on the given devices.
137*e4b0a90eSBrooks Davis.It Cm dump
138*e4b0a90eSBrooks DavisDump metadata stored on the given devices.
139*e4b0a90eSBrooks Davis.It Cm list
140*e4b0a90eSBrooks DavisSee
141*e4b0a90eSBrooks Davis.Xr geom 8 .
142*e4b0a90eSBrooks Davis.It Cm status
143*e4b0a90eSBrooks DavisSee
144*e4b0a90eSBrooks Davis.Xr geom 8 .
145*e4b0a90eSBrooks Davis.It Cm load
146*e4b0a90eSBrooks DavisSee
147*e4b0a90eSBrooks Davis.Xr geom 8 .
148*e4b0a90eSBrooks Davis.It Cm unload
149*e4b0a90eSBrooks DavisSee
150*e4b0a90eSBrooks Davis.Xr geom 8 .
151*e4b0a90eSBrooks Davis.El
152*e4b0a90eSBrooks Davis.Pp
153*e4b0a90eSBrooks DavisAdditional options:
154*e4b0a90eSBrooks Davis.Bl -tag -width indent
155*e4b0a90eSBrooks Davis.It Fl f
156*e4b0a90eSBrooks DavisForce the removal of the specified cache device.
157*e4b0a90eSBrooks Davis.It Fl v
158*e4b0a90eSBrooks DavisBe more verbose.
159*e4b0a90eSBrooks Davis.El
160*e4b0a90eSBrooks Davis.Sh SYSCTL VARIABLES
161*e4b0a90eSBrooks DavisThe following
162*e4b0a90eSBrooks Davis.Xr sysctl 8
163*e4b0a90eSBrooks Davisvariables can be used to control the behavior of the
164*e4b0a90eSBrooks Davis.Nm CACHE
165*e4b0a90eSBrooks DavisGEOM class.
166*e4b0a90eSBrooks DavisThe default value is shown next to each variable.
167*e4b0a90eSBrooks Davis.Bl -tag -width indent
168*e4b0a90eSBrooks Davis.It Va kern.geom.cache.used_hi : No 20
169*e4b0a90eSBrooks Davis.It Va kern.geom.cache.used_lo : No 5
170*e4b0a90eSBrooks Davis.It Va kern.geom.cache.idletime : No 5
171*e4b0a90eSBrooks Davis.It Va kern.geom.cache.timeout : No 10
172*e4b0a90eSBrooks Davis.It Va kern.geom.cache.enable : No 1
173*e4b0a90eSBrooks Davis.It Va kern.geom.cache.debug : No 0
174*e4b0a90eSBrooks DavisDebug level of the
175*e4b0a90eSBrooks Davis.Nm CACHE
176*e4b0a90eSBrooks DavisGEOM class.
177*e4b0a90eSBrooks DavisThis can be set to a number between 0 and 3 inclusive.
178*e4b0a90eSBrooks DavisIf set to 0 minimal debug information is printed, and if set to 3 the
179*e4b0a90eSBrooks Davismaximum amount of debug information is printed.
180*e4b0a90eSBrooks Davis.El
181*e4b0a90eSBrooks Davis.Sh EXIT STATUS
182*e4b0a90eSBrooks DavisExit status is 0 on success, and 1 if the command fails.
183*e4b0a90eSBrooks Davis.Sh SEE ALSO
184*e4b0a90eSBrooks Davis.Xr geom 4 ,
185*e4b0a90eSBrooks Davis.Xr geom 8
186*e4b0a90eSBrooks Davis.Sh HISTORY
187*e4b0a90eSBrooks DavisThe
188*e4b0a90eSBrooks Davis.Nm
189*e4b0a90eSBrooks Davisutility appeared in
190*e4b0a90eSBrooks Davis.Fx 7.0 .
191*e4b0a90eSBrooks Davis.Sh AUTHORS
192*e4b0a90eSBrooks Davis.An Ruslan Ermilov Aq Mt ru@FreeBSD.org
193