Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
JAliEn
JAliEn
Commits
6e3b034d
Commit
6e3b034d
authored
May 05, 2021
by
Costin Grigoras
Browse files
Separate executors for work and SSL handling
parent
c4fa3efb
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/main/java/alien/api/DispatchSSLServerNIO.java
View file @
6e3b034d
...
@@ -80,11 +80,15 @@ public class DispatchSSLServerNIO implements Runnable {
...
@@ -80,11 +80,15 @@ public class DispatchSSLServerNIO implements Runnable {
private
static
final
AtomicInteger
threadNo
=
new
AtomicInteger
();
private
static
final
AtomicInteger
threadNo
=
new
AtomicInteger
();
private
static
final
AtomicInteger
sslThreadNo
=
new
AtomicInteger
();
/**
/**
* Thread pool handling messages
* Thread pool handling messages
*/
*/
private
static
ThreadPoolExecutor
executor
=
new
CachedThreadPool
(
200
,
1
,
TimeUnit
.
MINUTES
,
(
r
)
->
new
Thread
(
r
,
"DispatchSSLServerNIO - "
+
threadNo
.
incrementAndGet
()));
private
static
ThreadPoolExecutor
executor
=
new
CachedThreadPool
(
200
,
1
,
TimeUnit
.
MINUTES
,
(
r
)
->
new
Thread
(
r
,
"DispatchSSLServerNIO - "
+
threadNo
.
incrementAndGet
()));
private
static
ThreadPoolExecutor
sslExecutor
=
new
CachedThreadPool
(
32
,
1
,
TimeUnit
.
MINUTES
,
(
r
)
->
new
Thread
(
r
,
"SSLNegociator- "
+
sslThreadNo
.
incrementAndGet
()));
private
static
final
int
defaultPort
=
8098
;
private
static
final
int
defaultPort
=
8098
;
private
static
String
serviceName
=
"apiService"
;
private
static
String
serviceName
=
"apiService"
;
...
@@ -112,6 +116,12 @@ public class DispatchSSLServerNIO implements Runnable {
...
@@ -112,6 +116,12 @@ public class DispatchSSLServerNIO implements Runnable {
names
.
add
(
"executorActiveCount"
);
names
.
add
(
"executorActiveCount"
);
values
.
add
(
Double
.
valueOf
(
executor
.
getActiveCount
()));
values
.
add
(
Double
.
valueOf
(
executor
.
getActiveCount
()));
names
.
add
(
"sslExecutorPoolSize"
);
values
.
add
(
Double
.
valueOf
(
sslExecutor
.
getPoolSize
()));
names
.
add
(
"sslExecutorActiveCount"
);
values
.
add
(
Double
.
valueOf
(
sslExecutor
.
getActiveCount
()));
names
.
add
(
"eQueueSize"
);
names
.
add
(
"eQueueSize"
);
values
.
add
(
Double
.
valueOf
(
taskQueue
.
size
()));
values
.
add
(
Double
.
valueOf
(
taskQueue
.
size
()));
});
});
...
@@ -653,7 +663,7 @@ public class DispatchSSLServerNIO implements Runnable {
...
@@ -653,7 +663,7 @@ public class DispatchSSLServerNIO implements Runnable {
final
NioSslLogger
nioLogger
=
null
;
// disabled logging
final
NioSslLogger
nioLogger
=
null
;
// disabled logging
serverSocketChannel
=
new
SSLServerSocketChannel
(
plainSocketChannel
,
sslContext
,
e
xecutor
,
nioLogger
);
serverSocketChannel
=
new
SSLServerSocketChannel
(
plainSocketChannel
,
sslContext
,
sslE
xecutor
,
nioLogger
);
serverSocketChannel
.
needClientAuthentication
=
true
;
serverSocketChannel
.
needClientAuthentication
=
true
;
try
{
try
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment