From 96b76534eed24df7db88fe88926e258c4e123a20 Mon Sep 17 00:00:00 2001 From: Simon Rettberg Date: Wed, 2 Jul 2025 14:38:48 +0200 Subject: [server] Lower max memory usage of thrift handling Don't set initial buffer size to maximum allowed, also lower the maximum allowed message size. --- .../src/main/java/org/openslx/bwlp/sat/thrift/BinaryListener.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'dozentenmodulserver/src/main/java') diff --git a/dozentenmodulserver/src/main/java/org/openslx/bwlp/sat/thrift/BinaryListener.java b/dozentenmodulserver/src/main/java/org/openslx/bwlp/sat/thrift/BinaryListener.java index abf5721c..8f050c21 100644 --- a/dozentenmodulserver/src/main/java/org/openslx/bwlp/sat/thrift/BinaryListener.java +++ b/dozentenmodulserver/src/main/java/org/openslx/bwlp/sat/thrift/BinaryListener.java @@ -29,7 +29,7 @@ import org.openslx.thrifthelper.TBinaryProtocolSafe; public class BinaryListener implements Runnable { private static final Logger log = LogManager.getLogger(BinaryListener.class); - private static final int MAX_MSG_LEN = 30 * 1000 * 1000; + private static final int MAX_MSG_LEN = 8 * 1000 * 1000; private final SatelliteServer.Processor processor = new SatelliteServer.Processor( new ServerHandler()); @@ -74,8 +74,8 @@ public class BinaryListener implements Runnable { args.protocolFactory(protFactory); args.processor(processor); args.executorService(es); - args.stopTimeoutVal(2).stopTimeoutUnit(TimeUnit.MINUTES); - args.transportFactory(new TFastFramedTransport.Factory(MAX_MSG_LEN)); + args.stopTimeoutVal(15).stopTimeoutUnit(TimeUnit.SECONDS); + args.transportFactory(new TFastFramedTransport.Factory(8192, MAX_MSG_LEN)); return new TThreadPoolServer(args); } -- cgit v1.2.3-55-g7522