필터 지우기
필터 지우기

It is possible to change the capacity of an entity server dynamically?

조회 수: 1 (최근 30일)
Scott
Scott 2017년 4월 10일
답변: SUHIB SULIMAN 2022년 4월 21일
It is possible to change the capacity of an entity server dynamically? For example if the utilization exceeds some threshold then an the capacity increases (in effect adding another server). If so, how can this be done? Is there documentation I could look at? The entity server documentation didn't seem to have any clues.
For context, I'm modeling a cloud type service, where new servers are started as needed. I'm using the SimEvents library as it has queues, but if there is a better way I'd be happy to hear it.
Thanks.

채택된 답변

Mo Zhao
Mo Zhao 2017년 4월 13일
편집: Mo Zhao 2017년 4월 13일
Hi Scott,
Entity server itself does not support dynamic capacity currently. However, this is doable using several blocks in combination. Consider introducing several spare servers connected in parallel with the initial server, each connected thru an Entity Gate, which is controlled by the statistics port(#n) of the entity server(s) via a Simulink Function. If the number of entities in block exceeds certain threshold, the statistics would trigger the gate to open and place an additional server in connection.
You can also do this logic with MATLAB Discrete-Event System, where instead of drawing connections, you can write code to schedule the forwarding and processing events of server and this can put additional storages in use.
You can have a look at the complex examples to see how to use Simulink Functions with statistic ports of SimEvents blocks, and how to use MATLAB Discrete-Event System.
Thanks,
Mo

추가 답변 (2개)

Scott
Scott 2017년 4월 14일
Thanks. I went with the first approach since it's simpler to implement. The second approach is appealing since it is more flexible and I may try it later.
Thanks for the help!
Scott

SUHIB SULIMAN
SUHIB SULIMAN 2022년 4월 21일
shot_cnt=1000
rank_cnts=[{},{},{}]
for x in range(shot_cnt):
if (x%100)==0:
print(x)
a_i_range=[1,1.25]
b_i_range=[1,2]
c_i_range=[1,1.5]
"""##Import lib + read data from file"""
import pandas as pd
import numpy as np
import networkx as nx
#import matplotlib.pyplot as plt
df = pd.read_csv('data_files/swimdata.csv')

카테고리

Help CenterFile Exchange에서 Discrete-Event Simulation에 대해 자세히 알아보기

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by