Commit 595e1cc2c136f624ddf2309f5e0ee66e8290f5a9

Authored by Andrew Shvayka
1 parent d4b88f80

Performance improvements

... ... @@ -29,9 +29,9 @@ app-dispatcher {
29 29 executor = "fork-join-executor"
30 30 fork-join-executor {
31 31 # Min number of threads to cap factor-based parallelism number to
32   - parallelism-min = 2
  32 + parallelism-min = 1
33 33 # Max number of threads to cap factor-based parallelism number to
34   - parallelism-max = 12
  34 + parallelism-max = 1
35 35
36 36 # The parallelism factor is used to determine thread pool size using the
37 37 # following formula: ceil(available processors * factor). Resulting size
... ... @@ -54,7 +54,7 @@ rpc-dispatcher {
54 54 # Min number of threads to cap factor-based parallelism number to
55 55 parallelism-min = 2
56 56 # Max number of threads to cap factor-based parallelism number to
57   - parallelism-max = 12
  57 + parallelism-max = 8
58 58
59 59 # The parallelism factor is used to determine thread pool size using the
60 60 # following formula: ceil(available processors * factor). Resulting size
... ... @@ -82,7 +82,7 @@ core-dispatcher {
82 82 # The parallelism factor is used to determine thread pool size using the
83 83 # following formula: ceil(available processors * factor). Resulting size
84 84 # is then bounded by the parallelism-min and parallelism-max values.
85   - parallelism-factor = 1.0
  85 + parallelism-factor = 0.25
86 86 }
87 87 # How long time the dispatcher will wait for new actors until it shuts down
88 88 shutdown-timeout = 1s
... ... @@ -105,7 +105,7 @@ rule-dispatcher {
105 105 # The parallelism factor is used to determine thread pool size using the
106 106 # following formula: ceil(available processors * factor). Resulting size
107 107 # is then bounded by the parallelism-min and parallelism-max values.
108   - parallelism-factor = 1.0
  108 + parallelism-factor = 0.25
109 109 }
110 110 # How long time the dispatcher will wait for new actors until it shuts down
111 111 shutdown-timeout = 1s
... ... @@ -128,7 +128,7 @@ plugin-dispatcher {
128 128 # The parallelism factor is used to determine thread pool size using the
129 129 # following formula: ceil(available processors * factor). Resulting size
130 130 # is then bounded by the parallelism-min and parallelism-max values.
131   - parallelism-factor = 1.0
  131 + parallelism-factor = 0.25
132 132 }
133 133 # How long time the dispatcher will wait for new actors until it shuts down
134 134 shutdown-timeout = 1s
... ... @@ -152,7 +152,7 @@ session-dispatcher {
152 152 # The parallelism factor is used to determine thread pool size using the
153 153 # following formula: ceil(available processors * factor). Resulting size
154 154 # is then bounded by the parallelism-min and parallelism-max values.
155   - parallelism-factor = 1.0
  155 + parallelism-factor = 0.25
156 156 }
157 157 # How long time the dispatcher will wait for new actors until it shuts down
158 158 shutdown-timeout = 1s
... ...
... ... @@ -167,7 +167,7 @@ actors:
167 167 # Cache parameters
168 168 cache:
169 169 # Enable/disable cache functionality.
170   - enabled: "${CACHE_ENABLED:true}"
  170 + enabled: "${CACHE_ENABLED:false}"
171 171 device_credentials:
172 172 # Default time to store device credentials in cache, in seconds
173 173 time_to_live: "${CACHE_DEVICE_CREDENTIAL_TTL:3600}"
... ...
... ... @@ -25,9 +25,9 @@ import java.util.concurrent.TimeUnit;
25 25 @Slf4j
26 26 public class TestParams {
27 27 static final String TEST_PROPERTIES = "test.properties";
28   - static final long DEFAULT_TEST_DURATION = TimeUnit.MINUTES.toMillis(1);
  28 + static final long DEFAULT_TEST_DURATION = TimeUnit.SECONDS.toMillis(1);
29 29 static final long DEFAULT_TEST_INTERVAL = TimeUnit.MILLISECONDS.toMillis(100);
30   - static final int DEFAULT_DEVICE_COUNT = 25;
  30 + static final int DEFAULT_DEVICE_COUNT = 2000;
31 31 static final String DEFAULT_REST_URL = "http://localhost:8080";
32 32 static final String DEFAULT_MQTT_URLS = "tcp://localhost:1883";
33 33 static final String DEFAULT_USERNAME = "tenant@thingsboard.org";
... ...
... ... @@ -25,6 +25,7 @@
25 25 </encoder>
26 26 </appender>
27 27
  28 + <logger name="io.gatling.core.action.Pause" level="WARN"/>
28 29 <logger name="org.thingsboard" level="INFO" />
29 30
30 31 <root level="INFO">
... ...
... ... @@ -45,18 +45,18 @@ class MqttSimulation extends Simulation {
45 45 val connect = exec(mqtt("connect")
46 46 .connect())
47 47
48   - val publish = repeat(400) {
  48 + val publish = repeat(600) {
49 49 exec(mqtt("publish")
50   - .publish("v1/devices/me/telemetry", "{\"key1\":\"value1\", \"key2\":\"value2\"}", QoS.AT_LEAST_ONCE, retain = false))
  50 + .publish("v1/devices/me/telemetry", "{\"temperature\":\"42\"}", QoS.AT_LEAST_ONCE, retain = false)).pause(100 milliseconds)
51 51 }
52 52
53 53 val scn = scenario("Scenario Name")
54   - .feed(csv("/tmp/mqtt.csv").circular)
  54 + .feed(csv("/tmp/mqtt.csv"))
55 55 .exec(connect, publish)
56 56
57 57 setUp(
58 58 scn
59   - .inject(constantUsersPerSec(25) during (1 seconds))
  59 + .inject(constantUsersPerSec(1500) during (1 seconds))
60 60 ).protocols(mqttConf)
61 61
62 62 }
\ No newline at end of file
... ...
... ... @@ -76,7 +76,6 @@ public class MqttTransportService {
76 76
77 77 @PostConstruct
78 78 public void init() throws Exception {
79   - ResourceLeakDetector.setLevel(ResourceLeakDetector.Level.ADVANCED);
80 79 log.info("Starting MQTT transport...");
81 80 log.info("Lookup MQTT transport adaptor {}", adaptorName);
82 81 this.adaptor = (MqttTransportAdaptor) appContext.getBean(adaptorName);
... ...