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