]> git.evergreen-ils.org Git - OpenSRF.git/blob - examples/opensrf.xml.example
LP#1729610: Add a service useful for testing behavior in slow response conditions
[OpenSRF.git] / examples / opensrf.xml.example
1 <?xml version="1.0"?>
2 <!-- 
3 vim:et:ts=2:sw=2:
4 -->
5 <opensrf version="0.0.3">
6 <!-- 
7
8         There is one <host> entry for each server on the network.  Settings for the
9         'default' host are used for every setting that isn't overridden within a given 
10         host's config.  
11
12         To specify which applications a host is serving, list those applications
13         within that host's config section.  If the defaults are acceptible, then
14         that's all that needs to be added/changed.
15
16         Any valid XML may be added to the <default> block and server components will have 
17         acces to it.
18
19 -->
20
21   <default>
22     <dirs>
23
24       <!-- opensrf log files go in this directory -->
25       <log>LOCALSTATEDIR/log</log>
26
27       <!-- opensrf unix domaind socket files go here -->
28       <sock>LOCALSTATEDIR/lock</sock>
29
30       <!-- opensrf pids go here -->
31       <pid>LOCALSTATEDIR/run</pid>
32
33       <!-- global config directory -->
34       <conf>SYSCONFDIR</conf>
35     </dirs>
36
37     <!-- prefork, simple. prefork is suggested -->
38     <server_type>prefork</server_type>
39
40     <!-- Default doesn't host any apps -->
41     <activeapps/>
42     <cache>
43       <global>
44         <servers>
45
46           <!-- memcached server ip:port -->
47           <server>127.0.0.1:11211</server>
48
49         </servers>
50
51         <!-- maximum time that anything may stay in the cache -->
52         <max_cache_time>86400</max_cache_time>
53
54       </global>
55     </cache>
56
57     <!--
58     These are the defaults for every served app.  Each server should 
59     duplicate the node layout for any nodes that need changing.
60     Any settings that are overridden in the server specific section 
61     will be used as the config values for that server.  Any settings that are
62     not overridden will fall back on the defaults
63     Note that overriding 'stateless' will break things
64     -->
65
66     <apps>
67       <opensrf.persist>
68
69         <!--
70         How many seconds to wait between server 
71         requests before timing out a stateful server session.
72         -->
73         <keepalive>1</keepalive>
74
75         <!--
76         if 1, then we support stateless sessions (no connect required),
77         if 0 then we don't
78         -->
79         <stateless>1</stateless>
80
81         <!--
82         Tells the servers which language this implementation is coded in 
83         In this case non "perl" servers will not be able to load the module
84         -->
85         <language>perl</language>
86
87         <!-- Module the implements this application -->
88         <implementation>OpenSRF::Application::Persist</implementation>
89
90         <!-- max stateful REQUEST requests before a session automatically disconnects a client -->
91         <max_requests>97</max_requests>
92
93         <!-- this will disable the stderr output log for this service -->
94         <!--<diable_stderr>true</disable_stderr>-->
95
96         <!-- settings for the backend application drones.  These are probably sane defaults -->
97         <unix_config>
98
99           <!-- unix socket file -->
100           <unix_sock>opensrf.persist_unix.sock</unix_sock>
101
102           <!-- pid file -->
103           <unix_pid>opensrf.persist_unix.pid</unix_pid>
104
105           <!-- max requests per process backend before a child is recycled -->
106           <max_requests>1000</max_requests>
107
108           <!-- log file for this application -->
109           <unix_log>opensrf.persist_unix.log</unix_log>
110
111           <!-- Number of children to pre-fork -->
112           <min_children>5</min_children>
113
114           <!-- maximun number of children to fork -->
115           <max_children>25</max_children>
116
117           <!-- minimun number of spare forked children -->
118           <min_spare_children>2</min_spare_children>
119
120           <!-- max number of spare forked children -->
121           <max_spare_children>5</max_spare_children>
122
123         </unix_config>
124
125         <!-- Any additional setting for a particular application go in the app_settings node -->
126         <app_settings>
127
128           <!-- sqlite database file -->
129           <dbfile>LOCALSTATEDIR/persist.db</dbfile>
130
131         </app_settings>
132       </opensrf.persist>
133
134       <opensrf.math>
135         <keepalive>3</keepalive>
136         <stateless>1</stateless>
137         <language>c</language>
138         <implementation>libosrf_math.so</implementation>
139         <unix_config>
140           <unix_sock>opensrf.math_unix.sock</unix_sock>
141           <unix_pid>opensrf.math_unix.pid</unix_pid>
142           <max_requests>1000</max_requests>
143           <unix_log>opensrf.math_unix.log</unix_log>
144           <min_children>5</min_children>
145           <max_children>15</max_children>
146           <min_spare_children>2</min_spare_children>
147           <max_spare_children>5</max_spare_children>
148         </unix_config>
149       </opensrf.math>
150
151       <opensrf.dbmath>
152         <keepalive>3</keepalive>
153         <stateless>1</stateless>
154         <language>c</language>
155         <implementation>libosrf_dbmath.so</implementation>
156         <unix_config>
157           <max_requests>1000</max_requests>
158           <unix_log>opensrf.dbmath_unix.log</unix_log>
159           <unix_sock>opensrf.dbmath_unix.sock</unix_sock>
160           <unix_pid>opensrf.dbmath_unix.pid</unix_pid>
161           <min_children>5</min_children>
162           <max_children>15</max_children>
163           <min_spare_children>2</min_spare_children>
164           <max_spare_children>5</max_spare_children>
165         </unix_config>
166       </opensrf.dbmath>
167
168       <opensrf.settings>
169         <keepalive>1</keepalive>
170         <stateless>1</stateless>
171         <language>perl</language>
172         <implementation>OpenSRF::Application::Settings</implementation>
173         <max_requests>17</max_requests>
174         <unix_config>
175           <unix_sock>opensrf.settings_unix.sock</unix_sock>
176           <unix_pid>opensrf.settings_unix.pid</unix_pid>
177           <max_requests>1000</max_requests>
178           <unix_log>opensrf.settings_unix.log</unix_log>
179           <min_children>5</min_children>
180           <max_children>15</max_children>
181           <min_spare_children>3</min_spare_children>
182           <max_spare_children>5</max_spare_children>
183         </unix_config>
184       </opensrf.settings>
185
186       <opensrf.slooooooow>
187         <keepalive>1</keepalive>
188         <stateless>1</stateless>
189         <language>perl</language>
190         <implementation>OpenSRF::Application::Slooooooow</implementation>
191         <max_requests>100</max_requests>
192         <unix_config>
193           <unix_sock>opensrf.slooooooow_unix.sock</unix_sock>
194           <unix_pid>opensrf.slooooooow_unix.pid</unix_pid>
195           <max_requests>1000</max_requests>
196           <unix_log>opensrf.slooooooow_unix.log</unix_log>
197           <min_children>2</min_children>
198           <max_children>5</max_children>
199           <min_spare_children>1</min_spare_children>
200           <max_spare_children>2</max_spare_children>
201         </unix_config>
202       </opensrf.slooooooow>
203
204       <opensrf.validator>
205         <keepalive>1</keepalive>
206         <stateless>1</stateless>
207         <language>perl</language>
208         <implementation>OpenSRF::Application::Validator</implementation>
209         <max_requests>17</max_requests>
210         <unix_config>
211           <unix_sock>opensrf.validator_unix.sock</unix_sock>
212           <unix_pid>opensrf.validator_unix.pid</unix_pid>
213           <max_requests>1000</max_requests>
214           <unix_log>opensrf.validator_unix.log</unix_log>
215           <min_children>5</min_children>
216           <max_children>15</max_children>
217           <min_spare_children>3</min_spare_children>
218           <max_spare_children>5</max_spare_children>
219         </unix_config>
220         <app_settings>
221           <validators>
222             <emailaddress>
223               <modules>
224                 <a_regex>
225                     <implementation>OpenSRF::Application::Validator::EmailAddress::Regex</implementation>
226                 </a_regex>
227                 <b_dns>
228                     <implementation>OpenSRF::Application::Validator::EmailAddress::DNS</implementation>
229                     <check_mx_a>1</check_mx_a>
230                     <!-- Change this to a 1 to check for IPV6 records as well as IPV4 -->
231                     <check_aaaa>0</check_aaaa>
232                     <!-- Uncomment this to specify a resolve.conf-like config file for DNS lookups -->
233                     <!--<config_file>/path/to/file</config_file>-->
234                     <!-- A set of IPs to ignore - Useful when your DNS provider intercepts NXDOMAIN (say, OpenDNS) -->
235                     <ignore_ips>127.0.0.1,67.215.65.132</ignore_ips>
236                 </b_dns>
237               </modules>
238             </emailaddress>
239           </validators>
240         </app_settings>
241       </opensrf.validator>
242     </apps>
243   </default>
244
245   <hosts>
246
247     <localhost>
248       <!-- ^-=- 
249         Should match the fully qualified domain name of the host.
250
251         On Linux, the output of the following command is authoritative:
252         $ perl -MNet::Domain -e 'print Net::Domain::hostfqdn() . "\n";'
253
254         To use 'localhost' instead, run osrf_control with the 'localhost' flag
255       -->
256       <!-- List all of the apps this server will be running -->
257       <activeapps>
258         <appname>opensrf.persist</appname>
259         <appname>opensrf.settings</appname>
260         <appname>opensrf.math</appname>
261         <appname>opensrf.dbmath</appname>
262         <appname>opensrf.validator</appname>
263         <appname>opensrf.slooooooow</appname>
264       </activeapps>
265
266       <apps>
267
268 <!-- Example of an app-specific setting override -->
269         <opensrf.persist>
270           <app_settings>
271             <dbfile>LOCALSTATEDIR/persist-override.db</dbfile>
272           </app_settings>
273         </opensrf.persist>
274
275       </apps>
276
277     </localhost>
278
279   </hosts>
280
281 </opensrf>