Multi-Request Serverless Simulator¶
This class represents simulators for serverless computing platforms like Google Cloud Run that allow multiple requests to enter an instance concurrenctly, and scale the instances based on a preset maximum concurrency value set by the user.
-
class
simfaas.ParServerlessSimulator.
ParServerlessSimulator
(concurrency_value: int, *args, **kwargs)¶ Bases:
simfaas.ServerlessSimulator.ServerlessSimulator
ParServerlessSimulator is responsible for executing simulations of a sample serverless computing platform with the ability to handle concurrent request in each instance, mainly for the performance analysis and performance model evaluation purposes. For parameters, refer to
ServerlessSimulator
.- Parameters
concurrency_value (int) – The number of concurrent requests allowed for each function instance.
-
cold_start_arrival
(t)¶ Goes through the process necessary for a cold start arrival which includes generation of a new function instance in the COLD state and adding it to the cluster.
- Parameters
t (float) – The time at which the arrival has happened. This is used to record the creation time for the server and schedule the expiration of the instance if necessary.
-
get_average_conc_avgs
()¶ Get the time-averaged average concurrency levels among all instances.
- Returns
Average concurrency levels of instances
- Return type
float
-
get_result_dict
()¶ Get the results of the simulation as a dict, which can easily be integrated into web services.
- Returns
A dictionary of different characteristics.
- Return type
dict
-
is_warm_available
(t)¶ Whether we have at least one available instance in the warm pool that can process requests
- Parameters
t (float) – Current time
- Returns
True if at least one server is able to accept a request
- Return type
bool
-
print_trace_results
()¶ Print a brief summary of the results of the trace.
-
reset_trace
()¶ resets all the historical data to prepare the class for a new simulation with additional functionality added to base class.
-
update_hist_arrays
(t)¶ Update history arrays
- Parameters
t (float) – Current time