]> git.evergreen-ils.org Git - OpenSRF.git/blob - examples/opensrf.xml.example
providing option to connect to memcache at general connect time
[OpenSRF.git] / examples / opensrf.xml.example
1 <?xml version="1.0"?>
2 <opensrf version="0.0.1">
3 <!-- 
4
5         There is one <host> entry for each server on the network.  Settings for the
6         'default' host are used for every setting that isn't overridden within a given 
7         host's config.  
8
9         To specify which applications a host is serving, list those applications
10         within that host's config section.  If the defaults are acceptible, then
11         that's all that needs to be added/changed.
12
13         Any valid XML may be added to the <default> block and server components will have 
14         acces to it.
15
16 -->
17
18   <default>
19     <dirs>
20
21       <!-- opensrf log files go in this directory -->
22       <log>/path/to/log</log>
23
24       <!-- opensrf unix domaind socket files go here -->
25       <sock>/path/to/sock</sock>
26
27       <!-- opensrf pids go here -->
28       <pid>/path/to/pid</pid>
29
30       <!-- global config directory -->
31       <conf>/path/to/conf</conf>
32     </dirs>
33
34     <!-- prefork, simple. prefork is suggested -->
35     <server_type>prefork</server_type>
36
37     <!-- Default doesn't host any apps -->
38     <activeapps/>
39     <cache>
40       <global>
41         <servers>
42
43           <!-- memcached server ip:port -->
44           <server>127.0.0.1:10101</server>
45
46         </servers>
47
48         <!-- maximun time that anything may stay in the cache -->
49         <max_cache_time>86400</max_cache_time>
50
51       </global>
52     </cache>
53
54 <!-- These are the defaults for every served app.  Each server should 
55         duplicate the node layout for any nodes that need changing.
56         Any settings that are overridden in the server specific section 
57         will be used as the config values for that server.  Any settings that are
58         not overridden will fall back on the defaults
59         Note that overriding 'stateless' will break things -->
60
61     <apps>
62       <opensrf.persist>
63
64         <!-- How many seconds to wait between server 
65         requests before timing out a stateful server session. -->
66         <keepalive>1</keepalive>
67
68         <!-- if 1, then we support stateless sessions (no connect required),
69         if 0 then we don't -->
70         <stateless>1</stateless>
71
72         <!-- Tells the servers which language this implementation is coded in 
73         In this case non "perl" servers will not be able to load the module -->
74         <language>perl</language>
75
76         <!-- Module the implements this application -->
77         <implementation>OpenSRF::Application::Persist</implementation>
78
79         <!-- max stateful requests before a session automatically disconnects a client -->
80         <max_requests>97</max_requests>
81
82         <!-- settings for the backend application drones.  These are probably sane defaults -->
83         <unix_config>
84
85           <!-- unix socket file -->
86           <unix_sock>opensrf.persist_unix.sock</unix_sock>
87
88           <!-- pid file -->
89           <unix_pid>opensrf.persist_unix.pid</unix_pid>
90
91           <!-- max requests per process backend before a child is recycled -->
92           <max_requests>1000</max_requests>
93
94           <!-- log file for this application -->
95           <unix_log>opensrf.persist_unix.log</unix_log>
96
97           <!-- Number of children to pre-fork -->
98           <min_children>5</min_children>
99
100           <!-- maximun number of children to fork -->
101           <max_children>25</max_children>
102
103           <!-- minimun number of spare forked children -->
104           <min_spare_children>2</min_spare_children>
105
106           <!-- max number of spare forked children -->
107           <max_spare_children>5</max_spare_children>
108
109         </unix_config>
110
111         <!-- Any additional setting for a particular application go in the app_settings node -->
112         <app_settings>
113
114           <!-- sqlite database file -->
115           <dbfile>/path/to/dbfile/persist.db</dbfile>
116
117         </app_settings>
118       </opensrf.persist>
119
120       <opensrf.math>
121         <keepalive>3</keepalive>
122         <stateless>1</stateless>
123         <language>perl</language>
124         <implementation>OpenSRF::Application::Demo::Math</implementation>
125         <max_requests>97</max_requests>
126         <unix_config>
127           <unix_sock>opensrf.math_unix.sock</unix_sock>
128           <unix_pid>opensrf.math_unix.pid</unix_pid>
129           <max_requests>1000</max_requests>
130           <unix_log>opensrf.math_unix.log</unix_log>
131           <min_children>5</min_children>
132           <max_children>15</max_children>
133           <min_spare_children>2</min_spare_children>
134           <max_spare_children>5</max_spare_children>
135         </unix_config>
136       </opensrf.math>
137
138       <opensrf.dbmath>
139         <keepalive>3</keepalive>
140         <stateless>1</stateless>
141         <language>perl</language>
142         <implementation>OpenSRF::Application::Demo::MathDB</implementation>
143         <max_requests>99</max_requests>
144         <unix_config>
145           <max_requests>1000</max_requests>
146           <unix_log>opensrf.dbmath_unix.log</unix_log>
147           <unix_sock>opensrf.dbmath_unix.sock</unix_sock>
148           <unix_pid>opensrf.dbmath_unix.pid</unix_pid>
149           <min_children>5</min_children>
150           <max_children>15</max_children>
151           <min_spare_children>2</min_spare_children>
152           <max_spare_children>5</max_spare_children>
153         </unix_config>
154       </opensrf.dbmath>
155
156       <opensrf.settings>
157         <keepalive>1</keepalive>
158         <stateless>0</stateless>
159         <language>perl</language>
160         <implementation>OpenSRF::Application::Settings</implementation>
161         <max_requests>17</max_requests>
162         <unix_config>
163           <unix_sock>opensrf.settings_unix.sock</unix_sock>
164           <unix_pid>opoensrf.settings_unix.pid</unix_pid>
165           <max_requests>1000</max_requests>
166           <unix_log>opensrf.settings_unix.log</unix_log>
167           <min_children>5</min_children>
168           <max_children>15</max_children>
169           <min_spare_children>3</min_spare_children>
170           <max_spare_children>5</max_spare_children>
171         </unix_config>
172       </opensrf.settings>
173     </apps>
174   </default>
175
176   <hosts>
177
178     <localhost>
179 <!-- ^-=-
180         Must match the fully qualified domain name of the host 
181         on Linux, this is usually the output of "hostname -f"
182 -->
183
184 <!-- List all of the apps this server will be running -->
185       <activeapps>
186         <appname>opensrf.persist</appname>
187         <appname>opensrf.settings</appname>
188         <appname>opensrf.math</appname>
189         <appname>opensrf.dbmath</appname>
190       </activeapps>
191
192       <apps>
193
194 <!-- Example of an app-specific setting override -->
195         <opensrf.persist>
196           <app_settings>
197             <dbfile>/different/path/to/dbfile/persist.db</dbfile>
198           </app_settings>
199         </opensrf.persist>
200
201       </apps>
202
203     </localhost>
204
205   </hosts>
206
207 </opensrf>