Limiter filter
What this is about
[SINCE Orbeon Forms 4.8]
The limiter filter is a servlet filter designed to limit the number of concurrent form processing requests, in order to reduce the likelihood of the server running out of resources.
Loading Form Runner pages and updating form state can be CPU and memory intensive, and a high level of concurrency for these operations is not desirable (even as we are working to improve the level of concurrency).
In the worst case, a large number of concurrent requests will compete for CPU and memory, causing slowdowns and possibly causing the server to run out of memory. In other cases, throughput can still be non-optimal.
It is therefore more efficient, past a certain level of concurrency, to serialize requests. Default Servlet containers settings are usually not adapted (Tomcat for example sets the default at 200 threads). They usually allow you to reduce the number of concurrent threads (Tomcat for example has settings on the <Connector>
element), but these settings have drawbacks:
Tomcat has a minimum of 10 concurrent threads.
Other containers have settings which are very hard to figure out.
Only some heavy requests must be serialized.
Therefore Orbeon Forms ships with a filter which implements the limiting mechanism internally.
Configuration
The filter is enabled by default in Orbeon Forms 4.8. It is configured in WEB-INF/web.xml
.
Here is a typical configuration:
The filter applies to all incoming requests. However, internally, the filter only limits requests matching paths which:
match the
include
parameter regular expressionand do not match the
exclude
parameter regular expression
The default settings are meant to apply to:
requests for forms
XForms Ajax requests
but not to:
assets such as JavaScript, CSS and images files
file uploads
The number of threads which can run concurrently is based on the number of CPUs advertised by the JVM. This typically includes hyperthreading: for example, a laptop with 4 cores advertises 8 "CPUs".
In the configuration, x1
means the advertised number of CPUs, x2
means twice that, .5x
means half that, etc. A fixed integer number can also be set.
The effective maximum number of concurrent threads allowed by the filter is:
min-threads
ifnum-threads
is smaller thanmin-threads
max-threads
ifnum-threads
is bigger thanmax-threads
num-threads
in all other cases
Disabling the filter
Remove or comment-out the relevant <filter-mapping>
in WEB-INF/web.xml
.
[SINCE Orbeon Forms 2023.1] If you are using Orbeon Forms 2023.1 or newer, the configuration above will look slightly different. Parameters are stored in <context-param>
instead of <init-param>
, and the parameter names are prefixed with oxf.orbeon-limiter-filter
. To disable the filter, add the following parameter:
See also
Last updated