From 439a23896bda9c4e954092816354914e645579b6 Mon Sep 17 00:00:00 2001 From: zhangmeng <775834166@qq.com> Date: 星期一, 10 六月 2019 09:37:13 +0800 Subject: [PATCH] 替换这个文件 --- QiaoJiaSystem/FaceDetectServer/main_detect.cpp | 19 ++++++++++++------- 1 files changed, 12 insertions(+), 7 deletions(-) diff --git a/QiaoJiaSystem/FaceDetectServer/main_detect.cpp b/QiaoJiaSystem/FaceDetectServer/main_detect.cpp index dabd089..7fdaea5 100644 --- a/QiaoJiaSystem/FaceDetectServer/main_detect.cpp +++ b/QiaoJiaSystem/FaceDetectServer/main_detect.cpp @@ -31,8 +31,8 @@ int threadMax = atol(ich->getProperties()->getProperty("user.thread.max").c_str()); #endif ich->getProperties()->setProperty("Ice.ThreadPool.Server.SizeMax", std::to_string(threadMax)); - appPref.setLongData("gpu.index", atol(gpuIndex.c_str())); - appPref.setLongData("thread.max", threadMax); + appPref.setIntData("gpu.index", atol(gpuIndex.c_str())); + appPref.setIntData("thread.max", threadMax); auto adapter = ich->createObjectAdapter(adapterName); adapter->add(new FaceDetectServerI(), Ice::stringToIdentity(identity)); @@ -47,13 +47,18 @@ ENABLEGLOG(GET_STR_CONFIG("logPath").c_str()); auto ich = Ice::initialize(argc, argv); - appPref.setLongData("gpu.index", 0); - appPref.setLongData("thread.max", 32); + if (argc < 4) { + assert("t_value.size()"); + } + appPref.setIntData("gpu.index", atoi(argv[1])); + appPref.setIntData("RpcFDPort", atoi(argv[2])); + appPref.setIntData("thread.max", atoi(argv[3]));//绾跨▼姹犲ぇ灏� - IceRpcServer<FaceDetectServerI> server("faceServer", 10002, "tcp"); + IceRpcServer<FaceDetectServerI> server("faceServer", appPref.getIntData("RpcFDPort"), "tcp"); server.setMessageSizeMax(1024 * 1024 * 50); - server.setPoolInitSize(10); - server.setPoolMaxSize(32); + server.setPoolInitSize(appPref.getIntData("thread.max")); + DBG("MaxPoolSize: " << std::max(appPref.getIntData("thread.max")*2, 32)); + server.setPoolMaxSize(std::max(appPref.getIntData("thread.max")*2, 32)); server.runWaitShutDown(); return 0; } -- Gitblit v1.8.0