Skip to content

Commit

Permalink
optimize admin config and thread pool
Browse files Browse the repository at this point in the history
  • Loading branch information
Pil0tXia committed Oct 16, 2023
1 parent 9a674cb commit b750590
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 24 deletions.
24 changes: 12 additions & 12 deletions eventmesh-runtime/conf/eventmesh.properties
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.
#
###############################EVNETMESH-runtime ENV#################################
########################## EventMesh Runtime Environment ##########################
eventMesh.server.idc=DEFAULT
eventMesh.server.env=PRD
eventMesh.server.provide.protocols=HTTP,TCP,GRPC
Expand All @@ -23,7 +23,7 @@ eventMesh.server.name=EVENTMESH-runtime
eventMesh.sysid=0000
eventMesh.server.http.port=10105
eventMesh.server.grpc.port=10205
########################## eventMesh tcp configuration ############################
########################## EventMesh TCP Configuration ##########################
eventMesh.server.tcp.enabled=true
eventMesh.server.tcp.port=10000
eventMesh.server.tcp.readerIdleSeconds=120
Expand All @@ -49,41 +49,41 @@ eventMesh.server.maxEventBatchSize=10
# thread number about global scheduler
eventMesh.server.global.scheduler=5
eventMesh.server.tcp.taskHandleExecutorPoolSize=8
#retry
# retry
eventMesh.server.retry.async.pushRetryTimes=3
eventMesh.server.retry.sync.pushRetryTimes=3
eventMesh.server.retry.async.pushRetryDelayInMills=500
eventMesh.server.retry.sync.pushRetryDelayInMills=500
eventMesh.server.retry.pushRetryQueueSize=10000
#admin
# runtime admin
eventMesh.server.admin.http.port=10106
#metaStorage
# metaStorage
eventMesh.server.metaStorage.metaStorageIntervalInMills=10000
eventMesh.server.metaStorage.fetchMetaStorageAddrIntervalInMills=20000
#auto-ack
# auto-ack
#eventMesh.server.defibus.client.comsumeTimeoutInMin=5

#sleep interval between closing client of different group in server graceful shutdown
# sleep interval between closing client of different group in server graceful shutdown
eventMesh.server.gracefulShutdown.sleepIntervalInMills=1000
eventMesh.server.rebalanceRedirect.sleepIntervalInMills=200

#ip address blacklist
# ip address blacklist
eventMesh.server.blacklist.ipv4=0.0.0.0/8,127.0.0.0/8,169.254.0.0/16,255.255.255.255/32
eventMesh.server.blacklist.ipv6=::/128,::1/128,ff00::/8

#connector plugin
# connector plugin
eventMesh.connector.plugin.type=standalone

#storage plugin
# storage plugin
eventMesh.storage.plugin.type=standalone

#security plugin
# security plugin
eventMesh.server.security.enabled=false
eventMesh.security.plugin.type=security
eventMesh.security.validation.type.token=false
eventMesh.security.publickey=

#metaStorage plugin
# metaStorage plugin
eventMesh.metaStorage.plugin.enabled=false
eventMesh.metaStorage.plugin.type=nacos
eventMesh.metaStorage.plugin.server-addr=127.0.0.1:8848
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -194,8 +194,7 @@ public void shutdown() throws Exception {
/**
* Registers the processors required by the runtime module
*/
public void registerProcessor(final Integer requestCode, final HttpRequestProcessor processor,
final ThreadPoolExecutor executor) {
public void registerProcessor(final Integer requestCode, final HttpRequestProcessor processor, final ThreadPoolExecutor executor) {
AssertUtils.notNull(requestCode, "requestCode can't be null");
AssertUtils.notNull(processor, "processor can't be null");
AssertUtils.notNull(executor, "executor can't be null");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -255,9 +255,9 @@ private void registerHTTPRequestProcessor() throws Exception {
final SendAsyncRemoteEventProcessor sendAsyncRemoteEventProcessor = new SendAsyncRemoteEventProcessor(this);
this.getHandlerService().register(sendAsyncRemoteEventProcessor, remoteMsgExecutor);

ThreadPoolExecutor adminExecutor = httpThreadPoolGroup.getAdminExecutor();
ThreadPoolExecutor runtimeAdminExecutor = httpThreadPoolGroup.getRuntimeAdminExecutor();
final AdminMetricsProcessor adminMetricsProcessor = new AdminMetricsProcessor(this);
registerProcessor(RequestCode.ADMIN_METRICS.getRequestCode(), adminMetricsProcessor, adminExecutor);
registerProcessor(RequestCode.ADMIN_METRICS.getRequestCode(), adminMetricsProcessor, runtimeAdminExecutor);

ThreadPoolExecutor clientManageExecutor = httpThreadPoolGroup.getClientManageExecutor();
final HeartBeatProcessor heartProcessor = new HeartBeatProcessor(this);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ public class HTTPThreadPoolGroup implements ThreadPoolGroup {
private ThreadPoolExecutor replyMsgExecutor;
private ThreadPoolExecutor pushMsgExecutor;
private ThreadPoolExecutor clientManageExecutor;
private ThreadPoolExecutor adminExecutor;
private ThreadPoolExecutor runtimeAdminExecutor;
private ThreadPoolExecutor webhookExecutor;

public HTTPThreadPoolGroup(EventMeshHTTPConfiguration eventMeshHttpConfiguration) {
Expand Down Expand Up @@ -73,11 +73,11 @@ public void initThreadPool() {
new LinkedBlockingQueue<>(eventMeshHttpConfiguration.getEventMeshServerClientManageBlockQSize()),
"eventMesh-clientManage", true);

adminExecutor = ThreadPoolFactory.createThreadPoolExecutor(
// The runtimeAdminExecutor here is for the runtime.admin package and has nothing to do with the eventmesh-admin module.
runtimeAdminExecutor = ThreadPoolFactory.createThreadPoolExecutor(
eventMeshHttpConfiguration.getEventMeshServerAdminThreadNum(),
eventMeshHttpConfiguration.getEventMeshServerAdminThreadNum(),
new LinkedBlockingQueue<>(50), "eventMesh-admin",
true);
new LinkedBlockingQueue<>(50), "eventMesh-runtime-admin", true);

replyMsgExecutor = ThreadPoolFactory.createThreadPoolExecutor(
eventMeshHttpConfiguration.getEventMeshServerReplyMsgThreadNum(),
Expand All @@ -96,8 +96,8 @@ public void shutdownThreadPool() {
if (batchMsgExecutor != null) {
batchMsgExecutor.shutdown();
}
if (adminExecutor != null) {
adminExecutor.shutdown();
if (runtimeAdminExecutor != null) {
runtimeAdminExecutor.shutdown();
}
if (clientManageExecutor != null) {
clientManageExecutor.shutdown();
Expand Down Expand Up @@ -140,8 +140,8 @@ public ThreadPoolExecutor getClientManageExecutor() {
return clientManageExecutor;
}

public ThreadPoolExecutor getAdminExecutor() {
return adminExecutor;
public ThreadPoolExecutor getRuntimeAdminExecutor() {
return runtimeAdminExecutor;
}

public ThreadPoolExecutor getWebhookExecutor() {
Expand Down

0 comments on commit b750590

Please sign in to comment.