opensrf.settings is stateless; having the wrong setting here causes great agony
[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>localhost:11211</server>
48
49         </servers>
50
51         <!-- maximun 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 requests before a session automatically disconnects a client -->
91         <max_requests>97</max_requests>
92
93         <!-- settings for the backend application drones.  These are probably sane defaults -->
94         <unix_config>
95
96           <!-- unix socket file -->
97           <unix_sock>opensrf.persist_unix.sock</unix_sock>
98
99           <!-- pid file -->
100           <unix_pid>opensrf.persist_unix.pid</unix_pid>
101
102           <!-- max requests per process backend before a child is recycled -->
103           <max_requests>1000</max_requests>
104
105           <!-- log file for this application -->
106           <unix_log>opensrf.persist_unix.log</unix_log>
107
108           <!-- Number of children to pre-fork -->
109           <min_children>5</min_children>
110
111           <!-- maximun number of children to fork -->
112           <max_children>25</max_children>
113
114           <!-- minimun number of spare forked children -->
115           <min_spare_children>2</min_spare_children>
116
117           <!-- max number of spare forked children -->
118           <max_spare_children>5</max_spare_children>
119
120         </unix_config>
121
122         <!-- Any additional setting for a particular application go in the app_settings node -->
123         <app_settings>
124
125           <!-- sqlite database file -->
126           <dbfile>/path/to/dbfile/persist.db</dbfile>
127
128         </app_settings>
129       </opensrf.persist>
130
131       <opensrf.math>
132         <keepalive>3</keepalive>
133         <stateless>1</stateless>
134         <language>perl</language>
135         <implementation>OpenSRF::Application::Demo::Math</implementation>
136         <max_requests>97</max_requests>
137         <unix_config>
138           <unix_sock>opensrf.math_unix.sock</unix_sock>
139           <unix_pid>opensrf.math_unix.pid</unix_pid>
140           <max_requests>1000</max_requests>
141           <unix_log>opensrf.math_unix.log</unix_log>
142           <min_children>5</min_children>
143           <max_children>15</max_children>
144           <min_spare_children>2</min_spare_children>
145           <max_spare_children>5</max_spare_children>
146         </unix_config>
147       </opensrf.math>
148
149       <opensrf.dbmath>
150         <keepalive>3</keepalive>
151         <stateless>1</stateless>
152         <language>perl</language>
153         <implementation>OpenSRF::Application::Demo::MathDB</implementation>
154         <max_requests>99</max_requests>
155         <unix_config>
156           <max_requests>1000</max_requests>
157           <unix_log>opensrf.dbmath_unix.log</unix_log>
158           <unix_sock>opensrf.dbmath_unix.sock</unix_sock>
159           <unix_pid>opensrf.dbmath_unix.pid</unix_pid>
160           <min_children>5</min_children>
161           <max_children>15</max_children>
162           <min_spare_children>2</min_spare_children>
163           <max_spare_children>5</max_spare_children>
164         </unix_config>
165       </opensrf.dbmath>
166
167       <opensrf.settings>
168         <keepalive>1</keepalive>
169         <stateless>1</stateless>
170         <language>perl</language>
171         <implementation>OpenSRF::Application::Settings</implementation>
172         <max_requests>17</max_requests>
173         <unix_config>
174           <unix_sock>opensrf.settings_unix.sock</unix_sock>
175           <unix_pid>opensrf.settings_unix.pid</unix_pid>
176           <max_requests>1000</max_requests>
177           <unix_log>opensrf.settings_unix.log</unix_log>
178           <min_children>5</min_children>
179           <max_children>15</max_children>
180           <min_spare_children>3</min_spare_children>
181           <max_spare_children>5</max_spare_children>
182         </unix_config>
183       </opensrf.settings>
184     </apps>
185   </default>
186
187   <hosts>
188
189     <localhost>
190 <!-- ^-=-
191         Must match the fully qualified domain name of the host 
192         on Linux, this is usually the output of "hostname -f"
193 -->
194
195 <!-- List all of the apps this server will be running -->
196       <activeapps>
197         <appname>opensrf.persist</appname>
198         <appname>opensrf.settings</appname>
199         <appname>opensrf.math</appname>
200         <appname>opensrf.dbmath</appname>
201       </activeapps>
202
203       <apps>
204
205 <!-- Example of an app-specific setting override -->
206         <opensrf.persist>
207           <app_settings>
208             <dbfile>/different/path/to/dbfile/persist.db</dbfile>
209           </app_settings>
210         </opensrf.persist>
211
212       </apps>
213
214     </localhost>
215
216   </hosts>
217
218 </opensrf>