diff --git a/server/gameserver/app.cc b/server/gameserver/app.cc index 91534ea..328bf38 100755 --- a/server/gameserver/app.cc +++ b/server/gameserver/app.cc @@ -53,15 +53,15 @@ const char* const PROJ_LOG_FILENAME_FMT = "log_$pid_%Y%m%d.log"; static void SavePerfLog() { - a8::UdpLog::Instance()->Info("max_mainloop_rundelay:%d room_num:%d player_num:%d online_num:%d max_http_time:%d " - "max_request_delay:%d http_pending_num:%d", + a8::UdpLog::Instance()->Info("max_mainloop_rundelay:%d room_num:%d player_num:%d online_num:%d " + "max_sys_request_delay:%d max_user_request_delay:%d http_pending_num:%d", { App::Instance()->perf.max_run_delay_time, RoomMgr::Instance()->RoomNum(), App::Instance()->perf.entity_num[ET_Player], PlayerMgr::Instance()->OnlineNum(), - App::Instance()->perf.max_http_time, - f8::HttpClientPool::Instance()->max_request_delay, + f8::HttpClientPool::Instance()->max_sys_request_delay, + f8::HttpClientPool::Instance()->max_user_request_delay, f8::HttpClientPool::Instance()->GetPendingNum() }); if (App::Instance()->HasFlag(4)) { @@ -106,8 +106,8 @@ static void SavePerfLog() App::Instance()->perf.params[4] = 0, App::Instance()->perf.params[5] = 0, App::Instance()->perf.params[6] = 0, - App::Instance()->perf.max_http_time = 0; - f8::HttpClientPool::Instance()->max_request_delay = 0; + f8::HttpClientPool::Instance()->max_sys_request_delay = 0; + f8::HttpClientPool::Instance()->max_user_request_delay = 0; } bool App::Init(int argc, char* argv[]) @@ -147,7 +147,7 @@ bool App::Init(int argc, char* argv[]) a8::Timer::Instance()->Init(); f8::MsgQueue::Instance()->Init(); f8::TGLog::Instance()->Init(a8::Format(PROJ_NAME_FMT, {GAME_ID}), false); - f8::HttpClientPool::Instance()->Init(10); + f8::HttpClientPool::Instance()->Init(MAX_ALL_HTTP_NUM, MAX_SYS_HTTP_NUM, MAX_USER_HTTP_NUM); JsonDataMgr::Instance()->Init(); MetaMgr::Instance()->Init(); uuid.SetMachineId((node_id - 1) * MAX_NODE_ID + instance_id); diff --git a/server/gameserver/constant.h b/server/gameserver/constant.h index 3c14c17..ca31157 100755 --- a/server/gameserver/constant.h +++ b/server/gameserver/constant.h @@ -199,3 +199,7 @@ const int MAX_INSTANCE_ID = 500; const int WALK_ZONE_WIDTH = 100; const int MAX_TEAM_NUM = 4; + +const int MAX_SYS_HTTP_NUM = 2; +const int MAX_USER_HTTP_NUM = 8; +const int MAX_ALL_HTTP_NUM = MAX_SYS_HTTP_NUM + MAX_USER_HTTP_NUM; diff --git a/server/gameserver/human.cc b/server/gameserver/human.cc index 0d764b6..13aab32 100644 --- a/server/gameserver/human.cc +++ b/server/gameserver/human.cc @@ -2066,7 +2066,7 @@ void Human::InternalSendGameOver() on_error, url.c_str(), *params, - room->room_uuid + MAX_SYS_HTTP_NUM + (room->room_uuid % MAX_USER_HTTP_NUM) ); delete params; sending_gameover_ = true; diff --git a/server/gameserver/roommgr.cc b/server/gameserver/roommgr.cc index 07d7c87..e5448d3 100644 --- a/server/gameserver/roommgr.cc +++ b/server/gameserver/roommgr.cc @@ -190,7 +190,7 @@ void RoomMgr::ReportServerState(int instance_id, const std::string& host, int po on_error, url.c_str(), *url_params, - rand() + rand() % MAX_SYS_HTTP_NUM ); delete url_params; } diff --git a/server/gameserver/types.h b/server/gameserver/types.h index bad179b..273b7dc 100755 --- a/server/gameserver/types.h +++ b/server/gameserver/types.h @@ -12,7 +12,6 @@ struct PerfMonitor long long test_times = 0; long long ray_times = 0; long long ray_time = 0; - long long max_http_time = 0; std::array params = {}; std::array entity_num = {}; }; diff --git a/third_party/framework b/third_party/framework index 21332b6..c71e7fb 160000 --- a/third_party/framework +++ b/third_party/framework @@ -1 +1 @@ -Subproject commit 21332b63ad3066027c004aae21cfb277283bf985 +Subproject commit c71e7fb8b5a5d08727c3d71552d53285f99dd328