From d0b0c5f316944a3133a26cc5340ec293f719b500 Mon Sep 17 00:00:00 2001 From: Nick Hastings Date: Tue, 19 Sep 2023 09:43:04 +0900 Subject: [PATCH 2/2] Increase MAX_CLIENTS from 64 to 256 In 2012 MAX_CLIENTS was increased from 64 to 128 for the t2kgsc. This allowed double the number of frontends or clients. See elog entry at https://elog.nd280.org/elog/GSC/808 For the new gsc this is further increased to 256. This necessitates updating the size checks of the BUFFER_HEADER and DATABASE_HEADER structs. BUFFER_HEADER = 32 + 7*4 + 256*MAX_CLIENTS current: = 32 + 7*4 + 256*64 = 16444 -> Confirmed in odb.cxx updated: = 32 + 7*4 + 256*256 = 65596 DATABASE_HEADER = 32 + 8*4 + 32832*MAX_CLIENTS current: = 32 + 8*4 + 32832*64 = 2101312 -> Confirmed in odb.cxx updated: = 32 + 8*4 + 32832*256 = 8405056 N.B. When the corresponding change was made in 2012 the value of MAX_RPC_CONNECTION was increased from 64 to 96. No equivalent change is made now since it was removed from midas in 2021 commit 9c93bc7f "RPC_SERVER_ACCEPTION cleanup". --- include/midas.h | 2 +- src/odb.cxx | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/include/midas.h b/include/midas.h index 46d653f4..43ca476e 100644 --- a/include/midas.h +++ b/include/midas.h @@ -271,7 +271,7 @@ class MJsonNode; // forward declaration from mjson.h #define NAME_LENGTH 32 /**< length of names, mult.of 8! */ #define HOST_NAME_LENGTH 256 /**< length of TCP/IP names */ -#define MAX_CLIENTS 64 /**< client processes per buf/db */ +#define MAX_CLIENTS 256 /**< client processes per buf/db */ #define MAX_EVENT_REQUESTS 10 /**< event requests per client */ #define MAX_OPEN_RECORDS 4096 /**< number of open DB records */ #define MAX_ODB_PATH 256 /**< length of path in ODB */ diff --git a/src/odb.cxx b/src/odb.cxx index bc084612..b94cef29 100644 --- a/src/odb.cxx +++ b/src/odb.cxx @@ -1469,7 +1469,7 @@ static void db_validate_sizes() #ifdef OS_LINUX assert(sizeof(EVENT_REQUEST) == 16); // ODB v3 assert(sizeof(BUFFER_CLIENT) == 256); - assert(sizeof(BUFFER_HEADER) == 16444); + assert(sizeof(BUFFER_HEADER) == 65596); assert(sizeof(HIST_RECORD) == 20); assert(sizeof(DEF_RECORD) == 40); assert(sizeof(INDEX_RECORD) == 12); @@ -1478,7 +1478,7 @@ static void db_validate_sizes() assert(sizeof(KEYLIST) == 12); assert(sizeof(OPEN_RECORD) == 8); assert(sizeof(DATABASE_CLIENT) == 32832); - assert(sizeof(DATABASE_HEADER) == 2101312); + assert(sizeof(DATABASE_HEADER) == 8405056); assert(sizeof(EVENT_HEADER) == 16); //assert(sizeof(EQUIPMENT_INFO) == 696); has been moved to dynamic checking inside mhttpd.c assert(sizeof(EQUIPMENT_STATS) == 24); -- 2.47.3