diff --git a/src/XrdSsi/XrdSsiClient.cc b/src/XrdSsi/XrdSsiClient.cc index e1d4dba66a2..ae9233d944c 100644 --- a/src/XrdSsi/XrdSsiClient.cc +++ b/src/XrdSsi/XrdSsiClient.cc @@ -47,6 +47,7 @@ #include "XrdSsi/XrdSsiLogger.hh" #include "XrdSsi/XrdSsiProvider.hh" #include "XrdSsi/XrdSsiServReal.hh" +#include "XrdSsi/XrdSsiScale.hh" #include "XrdSsi/XrdSsiTrace.hh" #include "XrdSys/XrdSysLogger.hh" @@ -107,6 +108,8 @@ virtual rStat QueryResource(const char *rName, virtual void SetCBThreads(int cbNum, int ntNum); +virtual void SetSpread(short ssz); + virtual void SetTimeout(tmoType what, int tmoval); XrdSsiClientProvider() {} @@ -256,6 +259,17 @@ void XrdSsiClientProvider::SetScheduler() XrdSsi::schedP->Start(); } +/******************************************************************************/ +/* X r d S s i C l i e n t P r o v i d e r : : S e t S p r e a d */ +/******************************************************************************/ + +void XrdSsiClientProvider::SetSpread(short ssz) +{ + extern XrdSsiScale sidScale; + + sidScale.setSpread(ssz); +} + /******************************************************************************/ /* X r d S s i C l i e n t P r o v i d e r : : S e t T i m e o u t */ /******************************************************************************/ diff --git a/src/XrdSsi/XrdSsiProvider.hh b/src/XrdSsi/XrdSsiProvider.hh index fba808891a6..67a2d95a5c6 100644 --- a/src/XrdSsi/XrdSsiProvider.hh +++ b/src/XrdSsi/XrdSsiProvider.hh @@ -89,6 +89,26 @@ class XrdSsiProvider { public: +//----------------------------------------------------------------------------- +//! Issue a control operation (future). +//! +//! @param cmd The control command. +//! @param argP The operational argument cast to a void pointer. +//! @param resP A reference to the pointer to hold the operational +//! result object if any. +//! +//! @return Upon success 0 is returned and if a resutt is returned is must +//! cast to te correct pointer type and deleted,when no longer needed. +//! Upon failure, -errno is returned. +//----------------------------------------------------------------------------- + +enum CTL_Cmd {CTL_None = 0}; + +virtual int Control(CTL_Cmd cmd, const void *argP, void *&resP) + {(void)cmd; (void)argP; (void)resP; + return (cmd == CTL_None ? 0 : -ENOTSUP); + } + //----------------------------------------------------------------------------- //! Obtain a service object (client-side or server-side). //! @@ -222,6 +242,16 @@ virtual void ResourceRemoved(const char *rName) {} virtual void SetCBThreads(int cbNum, int ntNum=0) {(void)cbNum; (void)ntNum;} +//----------------------------------------------------------------------------- +//! Set the client-size request spread size. +//! +//! @param ssz The maximum number of connections to use to to handle +//! requests. The initial default is 4. This method may be +//! called at any time. An ssz value > 1024 is set to 1024. +//----------------------------------------------------------------------------- + +virtual void SetSpread(short ssz) {(void)ssz;} + //----------------------------------------------------------------------------- //! Set default global timeouts. By default, all timeouts are set to infinity. //! diff --git a/src/XrdSsi/XrdSsiScale.hh b/src/XrdSsi/XrdSsiScale.hh index e9fd3ae5c52..1f2518e1433 100644 --- a/src/XrdSsi/XrdSsiScale.hh +++ b/src/XrdSsi/XrdSsiScale.hh @@ -37,9 +37,9 @@ class XrdSsiScale { public: -static const int maxSprd =256; -static const int maxEnt = 32; // Must be power of two -static const int entShft = 8; // Allows a spread of 256 +static const int maxSprd = 1024; +static const int maxEnt = 32; // Must be power of two +static const int entShft = 10; // Allows a spread of 1024 static const unsigned int maxPend = 65500; int getEnt() {entMutex.Lock(); @@ -88,9 +88,11 @@ bool rsvEnt(int xEnt) {xEnt >>= entShft; return false; } -void setSpread(short sval) {if (sval <= 0) maxSpread = 0; +void setSpread(short sval) {entMutex.Lock(); + if (sval <= 0) maxSpread = 0; else if (sval < maxSprd) maxSpread = sval; else maxSpread = maxSprd; + entMutex.UnLock(); } XrdSsiScale() : nowEnt(0), maxSpread(4), nowSpread(0)