Skip to content

Commit a44647a

Browse files
committed
Disable CQL ExecutorService by default
Follow up to #2741 CQL ExecutorPool just adds overhead without good benefits Reason why it was enabled for 0.6.x version is here: #2545 (reply in thread) As the next JanusGraph version is a major one, it makes sense to introduce this breaking change Signed-off-by: Oleksandr Porunov <[email protected]>
1 parent fd3b92c commit a44647a

File tree

4 files changed

+15
-2
lines changed

4 files changed

+15
-2
lines changed

docs/changelog.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -252,6 +252,16 @@ Notice that `janusgraph-cql` and `janusgraph-scylla` are mutually exclusive. Use
252252
provide both dependencies in the same classpath. See [ScyllaDB Storage Backend documentation](storage-backend/scylladb.md) for more
253253
information about how to make `scylla` `storage.backend` options available.
254254

255+
##### Disable CQL ExecutorService by default
256+
257+
Previously CQL ExecutorService was enabled by default mostly for historical reasons.
258+
CQL ExecutorService managed by JanusGraph adds additional overhead without bringing any usefulness other than
259+
limiting amount of parallel queries which can (and should) be controlled via the underlying CQL driver.
260+
261+
In case previous behaviour is desired then `storage.cql.executor-service.enabled` configuration option should be set to `true`,
262+
but it's recommended to tune CQL queries parallelism using CQL driver configuration options (like `storage.cql.max-requests-per-connection`,
263+
`storage.cql.local-max-connections-per-host`) and / or `storage.parallel-backend-ops.*` configuration options.
264+
255265
##### Removal of deprecated classes/methods/functionalities
256266

257267
###### Methods

docs/configs/janusgraph-cfg.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -451,7 +451,7 @@ Configuration options for CQL executor service which is used to process CQL quer
451451
| ---- | ---- | ---- | ---- | ---- |
452452
| storage.cql.executor-service.class | The implementation of `ExecutorService` to use. The full name of the class which extends `ExecutorService` which has either a public constructor with `ExecutorServiceConfiguration` argument (preferred constructor) or a public parameterless constructor. Other accepted options are: `fixed` - fixed thread pool of size `core-pool-size`; `cached` - cached thread pool; | String | fixed | LOCAL |
453453
| storage.cql.executor-service.core-pool-size | Core pool size for executor service. May be ignored if custom executor service is used (depending on the implementation of the executor service). | Integer | 10 | LOCAL |
454-
| storage.cql.executor-service.enabled | Whether to use CQL executor service to process queries or not. If not used, the parallelism will be controlled internally by the CQL driver via `storage.cql.max-requests-per-connection` parameter which may be preferable in production environments. Disabling executor service reduces overhead of thread pool but might be more difficult to tune. | Boolean | true | LOCAL |
454+
| storage.cql.executor-service.enabled | Whether to use CQL executor service to process queries or not. If not used, the parallelism will be controlled internally by the CQL driver via `storage.cql.max-requests-per-connection` parameter which may be preferable in production environments. Disabling executor service reduces overhead of thread pool but might be more difficult to tune. | Boolean | false | LOCAL |
455455
| storage.cql.executor-service.keep-alive-time | Keep alive time in milliseconds for executor service. When the number of threads is greater than the `core-pool-size`, this is the maximum time that excess idle threads will wait for new tasks before terminating. Ignored for `fixed` executor service and may be ignored if custom executor service is used (depending on the implementation of the executor service). | Long | 60000 | LOCAL |
456456
| storage.cql.executor-service.max-pool-size | Maximum pool size for executor service. Ignored for `fixed` and `cached` executor services. May be ignored if custom executor service is used (depending on the implementation of the executor service). | Integer | 2147483647 | LOCAL |
457457
| storage.cql.executor-service.max-shutdown-wait-time | Max shutdown wait time in milliseconds for executor service threads to be finished during shutdown. After this time threads will be interrupted (signalled with interrupt) without any additional wait time. | Long | 60000 | LOCAL |

janusgraph-cql/src/main/java/org/janusgraph/diskstorage/cql/CQLConfigOptions.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -612,7 +612,7 @@ public interface CQLConfigOptions {
612612
"Disabling executor service reduces overhead of thread pool but might be more difficult to tune.",
613613
ConfigOption.Type.LOCAL,
614614
Boolean.class,
615-
true);
615+
false);
616616

617617
ConfigOption<Integer> EXECUTOR_SERVICE_CORE_POOL_SIZE = new ConfigOption<>(
618618
EXECUTOR_SERVICE,

janusgraph-cql/src/test/java/org/janusgraph/diskstorage/cql/CQLConfigTest.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,7 @@
6262

6363
import static org.janusgraph.diskstorage.cql.CQLConfigOptions.BASE_PROGRAMMATIC_CONFIGURATION_ENABLED;
6464
import static org.janusgraph.diskstorage.cql.CQLConfigOptions.EXECUTOR_SERVICE_CLASS;
65+
import static org.janusgraph.diskstorage.cql.CQLConfigOptions.EXECUTOR_SERVICE_ENABLED;
6566
import static org.janusgraph.diskstorage.cql.CQLConfigOptions.EXECUTOR_SERVICE_MAX_SHUTDOWN_WAIT_TIME;
6667
import static org.janusgraph.diskstorage.cql.CQLConfigOptions.FILE_CONFIGURATION;
6768
import static org.janusgraph.diskstorage.cql.CQLConfigOptions.HEARTBEAT_TIMEOUT;
@@ -326,6 +327,7 @@ public void testRequestLoggerConfigurationSet() {
326327
public void shouldCreateCachedThreadPool() {
327328
WriteConfiguration wc = getConfiguration();
328329
wc.set(ConfigElement.getPath(EXECUTOR_SERVICE_CLASS), ExecutorServiceBuilder.CACHED_THREAD_POOL_CLASS);
330+
wc.set(ConfigElement.getPath(EXECUTOR_SERVICE_ENABLED), true);
329331
graph = (StandardJanusGraph) JanusGraphFactory.open(wc);
330332
assertDoesNotThrow(() -> {
331333
graph.traversal().V().hasNext();
@@ -336,6 +338,7 @@ public void shouldCreateCachedThreadPool() {
336338
@Test
337339
public void shouldGracefullyCloseGraphWhichLostAConnection(){
338340
WriteConfiguration wc = getConfiguration();
341+
wc.set(ConfigElement.getPath(EXECUTOR_SERVICE_ENABLED), true);
339342
wc.set(ConfigElement.getPath(EXECUTOR_SERVICE_MAX_SHUTDOWN_WAIT_TIME), 60000);
340343
wc.set(ConfigElement.getPath(PARALLEL_BACKEND_EXECUTOR_SERVICE_MAX_SHUTDOWN_WAIT_TIME), 60000);
341344
wc.set(ConfigElement.getPath(IDS_RENEW_TIMEOUT), 10000);

0 commit comments

Comments
 (0)