Compare commits
No commits in common. "0cb4b6815ccabcfeff412b67f70aa95f0e806352" and "ecb127e6afe897cb311da772564904a65ef789b2" have entirely different histories.
0cb4b6815c
...
ecb127e6af
3 changed files with 1 additions and 33 deletions
|
@ -31,7 +31,6 @@ readConfig = do
|
|||
-- waiting for timeout
|
||||
let
|
||||
speedup = read speedupString
|
||||
statsEvalD = 120 * 10^6 `div` speedup
|
||||
confBootstrapNodes' = case remainingArgs of
|
||||
bootstrapHost : bootstrapPortString : _ ->
|
||||
[(bootstrapHost, read bootstrapPortString)]
|
||||
|
@ -53,7 +52,6 @@ readConfig = do
|
|||
, confKChoicesOverload = 0.9
|
||||
, confKChoicesUnderload = 0.1
|
||||
, confKChoicesMaxVS = 8
|
||||
, confKChoicesRebalanceInterval = round (realToFrac statsEvalD * 1.1 :: Double)
|
||||
}
|
||||
sConf = ServiceConf
|
||||
{ confSubscriptionExpiryTime = 24*3600 / fromIntegral speedup
|
||||
|
@ -61,7 +59,7 @@ readConfig = do
|
|||
, confServiceHost = confDomainString
|
||||
, confLogfilePath = "../simulationData/logs/" <> confDomainString <> ".log"
|
||||
, confSpeedupFactor = speedup
|
||||
, confStatsEvalDelay = statsEvalD
|
||||
, confStatsEvalDelay = 120 * 10^6 `div` speedup
|
||||
}
|
||||
pure (fConf, sConf)
|
||||
|
||||
|
|
|
@ -322,34 +322,6 @@ kChoicesDepartureCost remainingOwnLoad ownCap thisSegmentLoad segment =
|
|||
+ abs (remainingOwnLoad + thisSegmentLoad) / ownCap
|
||||
- abs (segmentOwnerRemainingLoadTarget segment) / segmentOwnerCapacity segment
|
||||
|
||||
|
||||
kChoicesRebalanceThread :: (Service s (RealNodeSTM s)) => RealNodeSTM s -> IO ()
|
||||
kChoicesRebalanceThread nodeSTM = (confKChoicesRebalanceInterval . nodeConfig <$> readTVarIO nodeSTM) >>= rebalanceVS 0
|
||||
where
|
||||
rebalanceVS :: NodeID -> Int -> IO ()
|
||||
rebalanceVS startAt interval = do
|
||||
threadDelay interval
|
||||
(vsToRebalance', serv) <- atomically $ do
|
||||
node <- readTVar nodeSTM
|
||||
pure (rMapLookupPred 0 (vservers node), nodeService node)
|
||||
maybe
|
||||
-- wait and retry if no active VS available
|
||||
(rebalanceVS startAt interval)
|
||||
(\(vsNid, vsSTM) -> do
|
||||
vs <- readTVarIO vsSTM
|
||||
-- query neighbour node(s) load
|
||||
-- query own load
|
||||
-- calculate departure cost
|
||||
-- if deciding to re-balance, first leave and then join
|
||||
-- loop
|
||||
rebalanceVS vsNid interval
|
||||
)
|
||||
vsToRebalance'
|
||||
|
||||
|
||||
-- placeholder
|
||||
pure ()
|
||||
|
||||
-- | Join a new node into the DHT, using a provided bootstrap node as initial cache seed
|
||||
-- for resolving the new node's position.
|
||||
fediChordBootstrapJoin :: Service s (RealNodeSTM s)
|
||||
|
|
|
@ -459,8 +459,6 @@ data FediChordConf = FediChordConf
|
|||
-- ^ fraction of capacity below which a node considers itself underloaded
|
||||
, confKChoicesMaxVS :: Word8
|
||||
-- ^ upper limit of vserver index κ
|
||||
, confKChoicesRebalanceInterval :: Int
|
||||
-- ^ interval between vserver rebalance attempts
|
||||
}
|
||||
deriving (Show, Eq)
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue