@ConfigurationProperties(prefix="throttling", ignoreUnknownFields=false) public class ThrottlingProperties extends Object
Configuration properties that control throttling of operations. Throttling is
needed in order to avoid exhausting system resources or overloading the
Cassandra database cluster. This object is injected with properties that have
the throttling.*
prefix.
At the moment, throttling options are provided for two areas of operation:
Concurrently executed Cassandra statements: Processing statements causes load
on the database cluster. When processing too many statements in parallel,
this can lead to a situation in which statements take so long to be processed
that they time out. This can be avoided by limiting the number of statements
that are executed concurrently. The limits can be set separately for two
areas: statements that read or write samples (such statements are used by the
control-system supports) and statements that deal with sample meta-data (such
statements are used by the ChannelMetaDataDAO
.
Sample decimation: When adding a decimation level to a lot of channels that
already have a lot of raw samples, generating the decimated samples can
consume a lot of resources because this process involves reading all the
source (raw) samples. In particular, due to the fact that samples are read
from the database in pages, a lot of memory might be consumed for samples
that have been read from the database, but have not been processed yet. This
can lead to a situation in which the decimation process consumes all
available heap memory and triggers an OutOfMemoryError
. By
limiting the number of samples that may be kept in memory and delaying the
reading of samples for other channels until some of the samples in memory
have been processed, the amount of memory used can be limited.
Instances of this class are safe for concurrent read access but are not safe for concurrent write access. Typically, this should not be a problem because an instance of this class is initialized once at application startup and then only used for read access.
Constructor and Description |
---|
ThrottlingProperties()
Creates a properties object, initializing all properties with their
default values.
|
Modifier and Type | Method and Description |
---|---|
int |
getMaxConcurrentChannelMetaDataReadStatements()
Returns the maximum number of read statements that may be concurrently
executed by the
ChannelMetaDataDAO . |
int |
getMaxConcurrentChannelMetaDataWriteStatements()
Returns the maximum number of write statements that may be concurrently
executed by the
ChannelMetaDataDAO . |
int |
getMaxConcurrentControlSystemSupportReadStatements()
Returns the maximum number of read statements that may be concurrently
executed by all
ControlSystemSupport s. |
int |
getMaxConcurrentControlSystemSupportWriteStatements()
Returns the maximum number of write statements that may be concurrently
executed by all
ControlSystemSupport s. |
SampleDecimationThrottlingProperties |
getSampleDecimation()
Returns the configuration properties that control the sample decimation
process.
|
void |
setMaxConcurrentChannelMetaDataReadStatements(int maxConcurrentChannelMetaDataReadStatements)
Sets the maximum number of read statements that may be concurrently
executed by the
ChannelMetaDataDAO . |
void |
setMaxConcurrentChannelMetaDataWriteStatements(int maxConcurrentChannelMetaDataWriteStatements)
Sets the maximum number of write statements that may be concurrently
executed by the
ChannelMetaDataDAO . |
void |
setMaxConcurrentControlSystemSupportReadStatements(int maxConcurrentControlSystemSupportReadStatements)
Sets the maximum number of read statements that may be concurrently
executed by all
ControlSystemSupport s. |
void |
setMaxConcurrentControlSystemSupportWriteStatements(int maxConcurrentControlSystemSupportWriteStatements)
Sets the maximum number of write statements that may be concurrently
executed by all
ControlSystemSupport s. |
void |
setSampleDecimation(SampleDecimationThrottlingProperties sampleDecimation)
Sets the configuration properties that control the sample decimation
process.
|
public ThrottlingProperties()
public int getMaxConcurrentChannelMetaDataReadStatements()
ChannelMetaDataDAO
. Typically, these are read
statements that load a channel configuration or information object or
that look for pending channel operations. The default value is 64.ChannelMetaDataDAO
.public void setMaxConcurrentChannelMetaDataReadStatements(int maxConcurrentChannelMetaDataReadStatements)
ChannelMetaDataDAO
. Typically, these are read
statements that load a channel configuration or information object or
that look for pending channel operations. The default value is 64.maxConcurrentChannelMetaDataReadStatements
- maximum number of concurrently running read statements allowed
for the ChannelMetaDataDAO
. Must be greater than
zero.IllegalArgumentException
- if the specified value is less than one.public int getMaxConcurrentChannelMetaDataWriteStatements()
ChannelMetaDataDAO
. Typically, these are write
statements that modify a channel configuration and information object or
that add or remove pending channel operations. These write statements
typically are logged batch statements or light-weight transactions, so
they are significantly more expensive than regular write statements. The
default value is 16.ChannelMetaDataDAO
.public void setMaxConcurrentChannelMetaDataWriteStatements(int maxConcurrentChannelMetaDataWriteStatements)
ChannelMetaDataDAO
. Typically, these are write
statements that modify a channel configuration and information object or
that add or remove pending channel operations. These write statements
typically are logged batch statements or light-weight transactions, so
they are significantly more expensive than regular write statements. The
default value is 16.maxConcurrentChannelMetaDataWriteStatements
- maximum number of concurrently running write statements
allowed for the ChannelMetaDataDAO
. Must be
greater than zero.IllegalArgumentException
- if the specified value is less than one.public int getMaxConcurrentControlSystemSupportReadStatements()
ControlSystemSupport
s. Typically, these are read
statements that read samples from a sample bucket. All
ControlSystemSupport
s share the same session and thus all
their statements contribute towards reaching this limit. The default
value is 128.ControlSystemSupport
s.public void setMaxConcurrentControlSystemSupportReadStatements(int maxConcurrentControlSystemSupportReadStatements)
ControlSystemSupport
s. Typically, these are read
statements that read samples from a sample bucket. All
ControlSystemSupport
s share the same session and thus all
their statements contribute towards reaching this limit. The default
value is 128.maxConcurrentControlSystemSupportReadStatements
- maximum number of concurrently running read statements allowed
for all ControlSystemSupport
s.IllegalArgumentException
- if the specified value is less than one.public int getMaxConcurrentControlSystemSupportWriteStatements()
ControlSystemSupport
s. Typically, these are write
statements that write a single sample to a sample bucket, which means
that this kind of statements is rather cheap. All
ControlSystemSupport
s share the same session and thus all
their statements contribute towards reaching this limit. The default
value is 512.ControlSystemSupport
s.public void setMaxConcurrentControlSystemSupportWriteStatements(int maxConcurrentControlSystemSupportWriteStatements)
ControlSystemSupport
s. Typically, these are write
statements that write a single sample to a sample bucket, which means
that this kind of statements is rather cheap. All
ControlSystemSupport
s share the same session and thus all
their statements contribute towards reaching this limit. The default
value is 512.maxConcurrentControlSystemSupportWriteStatements
- maximum number of concurrently running write statements
allowed for all ControlSystemSupport
s.IllegalArgumentException
- if the specified value is less than one.public SampleDecimationThrottlingProperties getSampleDecimation()
public void setSampleDecimation(SampleDecimationThrottlingProperties sampleDecimation)
sampleDecimation
- configuration properties for throttling the sample decimation
process.Copyright © 2011–2017 aquenos GmbH. All rights reserved.