Distributed Shared Memory (DSM)
Distributed Shared Memory (DSM)
coherence and protocols, design issues. Distributed Scheduling, introduction, issues in load
distributing, components of a load distributing algorithm, stability, load distributing algorithm,
performance comparison, selecting a suitable load sharing algorithm, requirements for load
distributing, task migration and associated issues. Failure Recovery and Fault tolerance:
introduction, basic concepts, classification of failures, backward and forward error recovery,
backward error recovery, recovery in concurrent systems, consistent set of check points,
synchronous and asynchronous check pointing and recovery, check pointing for distributed
database systems, recovery in replicated distributed databases.
DISTRIBUTED SHARED MEMORY (DSM)
Distributed Shared Memory (DSM) is a concept in computer architecture where multiple
physically separate processors appear to share a single, coherent memory space. This approach
allows processes running on different processors to communicate by reading and writing shared
variables, as if they were using a single shared memory system, even though the physical
memories are distributed across multiple machines.
Distributed Shared Memory (DSM) implements the distributed systems shared memory model in
a distributed system, that hasn’t any physically shared memory. Shared model provides a virtual
address area shared between any or all nodes. To beat the high forged of communication in
distributed system. DSM memo, model provides a virtual address area shared between all nodes.
systems move information to the placement of access. Information moves between main memory
and secondary memory (within a node) and between main recollections of various nodes.
Every Greek deity object is in hand by a node. The initial owner is that the node that created the
object. possession will amendment as the object moves from node to node. Once a method
accesses information within the shared address space, the mapping manager maps shared
memory address to physical memory (local or remote).
DSM permits programs running on separate reasons to share information while not the software
engineer having to agitate causation message instead underlying technology can send the
messages to stay the DSM consistent between compute. DSM permits programs that wont to
treat constant laptop to be simply tailored to control on separate reason. Programs access what
seems to them to be traditional memory.
Hence, programs that Pine Tree State DSM square measure sometimes shorter and easier to
grasp than programs that use message passing. But, DSM isn’t appropriate for all things. Client-
server systems square measure typically less suited to DSM, however, a server is also wont to
assist in providing DSM practicality for information shared between purchasers.
Architecture of Distributed Shared Memory (DSM) :
Every node consists of 1 or additional CPU’s and a memory unit. High-speed communication
network is employed for connecting the nodes. A straightforward message passing system
permits processes on completely different nodes to exchange one another.
Memory mapping manager unit :
Memory mapping manager routine in every node maps the native memory onto the shared
computer storage. For mapping operation, the shared memory house is divided into blocks.
Information caching may be a documented answer to deal with operation latency. DMA uses
information caching to scale back network latency. the most memory of the individual nodes is
employed to cache items of the shared memory house.
Memory mapping manager of every node reads its native memory as an enormous cache of the
shared memory house for its associated processors. The bass unit of caching may be a memory
block. Systems that support DSM, information moves between secondary memory and main
memory also as between main reminiscences of various nodes.
Communication Network Unit :
Once method access information within the shared address house mapping manager maps the
shared memory address to the physical memory. The mapped layer of code enforced either
within the operating kernel or as a runtime routine.
Physical memory on every node holds pages of shared virtual–address house. Native pages area
unit gift in some node’s memory. Remote pages in some other node’s memory.
Some advantages of DSM:
Programming is a lot easier
No need to deal with communication details.
Easy to handle complex data structures
DSM systems are much cheaper than tightly coupled multiprocessor systems (DSMs can
be built over commodity components).
DSM takes advantages of the memory reference locality -- data are moved in the unit of
pages.
DSM can form a large physical memory.
Programs for shared memory multiprocessors can easily be ported to DSMs
Shared memory is the memory block that can be accessed by more than one program. A shared
memory concept is used to provide a way of communication and provide less redundant memory
management.
Distributed Shared Memory abbreviated as DSM is the implementation of shared memory
concept in distributed systems. The DSM system implements the shared memory models in
loosely coupled systems that are deprived of a local physical shared memory in the system. In
this type of system distributed shared memory provides a virtual memory space that is accessible
by all the system (also known as nodes) of the distributed hierarchy.
Some common challenges that are to be kept in mind while the implementation of DSM −
Tracking of the memory address (location) of data stored remotely in shared memory.
To reduce the communication delays and high overhead associated with the references to remote
data.
Controlling the concurrent access of the data shared in DSM.
Based on these challenges there are algorithms designed to implement distributed shared
memory. There are four algorithms −
Central Server Algorithm
Migration Algorithm
Read Replication Algorithm
Full Replication Algorithm
Central Server Algorithm
All shared data is maintained by the central server. Other nodes of the distributed system request
for reading and writing data to the server which serves the request and updates or provides access
to the data along with acknowledgment messages.
These acknowledgment messages are used to provide the status of the data request is served by
the server. When the data is sent to the calling function, it acknowledges a number that shows the
access sequence of the data to maintain concurrency. And time-out is returned in case of failure.
For larger distributed systems, there can be more than one server. In this case, the servers are
located using their address or using mapping functions.
Migration Algorithm
As the name suggest the migration algorithm does the work of migration of data elements.
Instead of using a central server serving each request, the block containing the data requested by
a system is migrated to it for further access and processing. It migrates the data on request.
This algorithm though is good if when a system accesses the same block of data multiple times
and the ability to integrate virtual memory concept, has some shortcomings that are needed to be
addressed.
Only one node is able to access the shared data element at a time and the whole block is migrated
to that node. Also, this algorithm is more prone to thrashing due to the migration of data items
upon request by the node.
DSM is a mechanism that manages memory across multiple nodes and makes inter-process
communications transparent to end-users. To design information shared memory we might deal
with certain issues which are called issues.
Issues to Design and Implementation of DSM:
Granularity
Structure of shared memory space
Memory coherence and access synchronization
Data location and access
Replacement strategy
Thrashing
Heterogeneity
1. Granularity: Granularity refers to the block size of a DSM system. Granularity refers to the
unit of sharing and the unit of data moving across the network when a network block
shortcoming then we can utilize the estimation of the block size as words/phrases. The block size
might be different for the various networks.
2.Structure of shared memory space: Structure refers to the design of the shared data in the
memory. The structure of the shared memory space of a DSM system is regularly dependent on
the sort of applications that the DSM system is intended to support.
3. Memory coherence and access synchronization: In the DSM system the shared data things
ought to be accessible by different nodes simultaneously in the network. The fundamental issue
in this system is data irregularity. The data irregularity might be raised by the synchronous
access. To solve this problem in the DSM system we need to utilize some synchronization
primitives, semaphores, event count, and so on.
4. Data location and access: To share the data in the DSM system it ought to be possible to
locate and retrieve the data as accessed by clients or processors. Therefore, the DSM system
must implement some form of data block finding system to serve network data to meet the
requirement of the memory coherence semantics being utilized.
5. Replacement strategy: In the local memory of the node is full, a cache miss at the node
implies not just a get of the gotten to information block from a remote node but also a
replacement. A data block of the local memory should be replaced by the new data block.
Accordingly, a position substitution methodology is additionally vital in the design of a DSM
system.
6. Thrashing: In a DSM system data blocks move between nodes on demand. In this way on the
off chance that 2 nodes compete for write access to the single data item. The data relating data
block might be moved to back and forth at such a high rate that no genuine work can get gone.
The DSM system should utilize an approach to keep away from a situation generally known as
thrashing.
7. Heterogeneity: The DSM system worked for homogeneous systems and need not address the
heterogeneity issue. In any case, assuming the underlined system environment is heterogeneous,
the DSM system should be designed to deal with heterogeneous, so it works appropriately with
machines having different architectures.
In this article, we will go through the concept of scheduling and load balancing in distributed
systems in detail.
Scheduling in Distributed Systems:
The techniques that are used for scheduling the processes in distributed systems are as follows:
Task Assignment Approach: In the Task Assignment Approach, the user-submitted process is
composed of multiple related tasks which are scheduled to appropriate nodes in a system to
improve the performance of a system as a whole.
Load Balancing Approach: In the Load Balancing Approach, as the name implies, the workload
is balanced among the nodes of the system.
Load Sharing Approach: In the Load Sharing Approach, it is assured that no node would be idle
while processes are waiting for their processing.
Note: The Task Assignment Approach finds less applicability
practically as it assumes that characteristics of processes
like inter-process communication cost, etc. must be known in advance.
Characteristics of a Good Scheduling Algorithm:
The following are the required characteristics of a Good Scheduling Algorithm:
The scheduling algorithms that require prior knowledge about the properties and resource
requirements of a process submitted by a user put a burden on the user. Hence, a good
scheduling algorithm does not require prior specification regarding the user-submitted process.
A good scheduling algorithm must exhibit the dynamic scheduling of processes as the initial
allocation of the process to a system might need to be changed with time to balance the load of
the system.
The algorithm must be flexible enough to process migration decisions when there is a change in
the system load.
The algorithm must possess stability so that processors can be utilized optimally. It is possible
only when thrashing overhead gets minimized and there should no wastage of time in process
migration.
An algorithm with quick decision making is preferable such as heuristic methods that take less
time due to less computational work give near-optimal results in comparison to an exhaustive
search that provides an optimal solution but takes more time.
A good scheduling algorithm gives balanced system performance by maintaining minimum
global state information as global state information (CPU load) is directly proportional to
overhead. So, with the increase in global state information overhead also increases.
The algorithm should not be affected by the failure of one or more nodes of the system.
Furthermore, even if the link fails and nodes of a group get separated into two or more groups
then also it should not break down. So, the algorithm must possess decentralized decision-
making capability in which consideration is given only to the available nodes for taking a
decision and thus, providing fault tolerance.
A good scheduling algorithm has the property of being scalable. It is flexible for scaling when
the number of nodes increases in a system. If an algorithm opts for a strategy in which it inquires
about the workload of all nodes and then selects the one with the least load then it is not
considered a good approach because it leads to poor scalability as it will not work well for a
system having many nodes. The reason is that the inquirer receives a lot many replies almost
simultaneously and the processing time spent for reply messages is too long for a node selection
with the increase in several nodes (N). A straightforward way is to examine only m of N nodes.
A good scheduling algorithm must be having fairness of service because in an attempt to balance
the workload on all nodes of the system there might be a possibility that nodes with more load
get more benefit as compared to nodes with less load because they suffer from poor response
time than stand-alone systems. Hence, the solution lies in the concept of load sharing in which a
node can share some of its resources until the user is not affected.
Load Balancing in Distributed Systems:
The Load Balancing approach refers to the division of load among the processing elements of a
distributed system. The excess load of one processing element is distributed to other processing
elements that have less load according to the defined limits. In other words, the load is
maintained at each processing element in such a manner that neither it gets overloaded nor idle
during the execution of a program to maximize the system throughput which is the ultimate goal
of distributed systems. This approach makes all processing elements equally busy thus speeding
up the entire task leads to the completion of the task by all processors approximately at the same
time.
Types of Load Balancing Algorithms:
Static Load Balancing Algorithm: In the Static Load Balancing Algorithm, while distributing
load the current state of the system is not taken into account. These algorithms are simpler in
comparison to dynamic load balancing algorithms. Types of Static Load Balancing Algorithms
are as follows:
Deterministic: In Deterministic Algorithms, the properties of nodes and processes are taken into
account for the allocation of processes to nodes. Because of the deterministic characteristic of the
algorithm, it is difficult to optimize to give better results and also costs more to implement.
Probabilistic: n Probabilistic Algorithms, Statistical attributes of the system are taken into
account such as several nodes, topology, etc. to make process placement rules. It does not give
better performance.
Dynamic Load Balancing Algorithm: Dynamic Load Balancing Algorithm takes into account
the current load of each node or computing unit in the system, allowing for faster processing by
dynamically redistributing workloads away from overloaded nodes and toward underloaded
nodes. Dynamic algorithms are significantly more difficult to design, but they can give superior
results, especially when execution durations for distinct jobs vary greatly. Furthermore, because
dedicated nodes for task distribution are not required, a dynamic load balancing architecture is
frequently more modular. Types of Dynamic Load Balancing Algorithms are as follows:
Centralized: In Centralized Load Balancing Algorithms, the task of handling requests for process
scheduling is carried out by a centralized server node. The benefit of this approach is efficiency
as all the information is held at a single node but it suffers from the reliability problem because
of the lower fault tolerance. Moreover, there is another problem with the increasing number of
requests.
Distributed: In Distributed Load Balancing Algorithms, the decision task of assigning processes
is distributed physically to the individual nodes of the system. Unlike Centralized Load
Balancing Algorithms, there is no need to hold state information. Hence, speed is fast.
Types of Distributed Load Balancing Algorithms:
Cooperative In Cooperative Load Balancing Algorithms, as the name implies, scheduling
decisions are taken with the cooperation of entities in the system. The benefit lies in the stability
of this approach. The drawback is the complexity involved which leads to more overhead than
Non-cooperative algorithms.
Non-cooperative: In Non-cooperative Load Balancing Algorithms, scheduling decisions are
taken by the individual entities of the system as they act as autonomous entities. The benefit is
that minor overheads are involved due to the basic nature of non-cooperation. The drawback is
that these algorithms might be less stable than Cooperative algorithms.
Issues in Designing Load-balancing Algorithms:
Many issues need to be taken into account while designing Load-balancing Algorithms:
Load Estimation Policies: Determination of a load of a node in a distributed system.
Process Transfer Policies: Decides for the execution of process: local or remote.
State Information Exchange: Determination of strategy for exchanging system load
information among the nodes in a distributed system.
Location Policy: Determining the selection of destination nodes for the migration of the process.
Priority Assignment: Determines whether the priority is given to a local or a remote process on
a node for execution.
Migration limit policy: Determines the limit value for the migration of processes.
Components of Load Distributing Algorithm :
A load distributing algorithm has 4 components –
Transfer Policy –
Determine whether or not a node is in a suitable state for a task transfer.
Process Selection Policy –
Determines the task to be transferred.
Site Location Policy –
Determines the node to which a task should be transferred to when it is selected for transfer.
Information Policy –
It is in-charge of initiating the gathering of system state data.
A transfer policy requires information on the local nodes state to make the decisions. A location
policy requires information on the states of the remote nodes to make the decision.
1. Transfer Policy –
Threshold policies make up a substantial portion of transfer policies. The threshold is measured
in units of load. The transfer policy determines that a node is a Sender when a new task begins at
that node and the load at the node exceeds a threshold T. If the node’s load falls below T, the
transfer policy determines that the node can be used as a remote task recipient.
2. Selection Policy –
A selection policy decides which task in the node should be transferred (as determined by the
transfer policy). If the selection policy cannot locate an appropriate job in the node, the transfer
procedure is halted until the transfer policy signals that the site is a sender again. The selection
policy selects a task for transfer after the transfer policy decides that the node is a sender.
The most straightforward method is to choose a recently generated task that has led the node to
become a sender by exceeding the load threshold.
On the other way, a job is only transferred if its response time improves as a result of the
transfer.
Other criteria to consider in a task selection approach are: first, the overhead imposed by the
transfer should be as low as possible, and second, the number of location-dependent calls made
by the selected task should be as low as possible.
3. Location Policy –
The location policy’s job is to discover suitable nodes for sharing. After the transfer policy has
determined that a task should be transmitted, the location policy must determine where the task
should be sent. This will be based on data collected through the information policy. Polling is a
widely used approach for locating a suitable node. In polling, a node polls another node to see if
it is a suitable load-sharing node. Nodes can be polled sequentially or concurrently. A site polls
other sites in a sequential or parallel manner to see whether they are acceptable for a transfer
and/or if they are prepared to accept one. For polling, nodes could be chosen at random or more
selectively depending on information obtained during prior polls. It’s possible that the number of
sites polled will change.
4. Information Policy –
The information policy is in charge of determining when information regarding the states of the
other nodes in the system should be collected. Most information policies fall into one of three
categories:
Demand – driven –
Using sender initiated or receiver initiated polling techniques, a node obtains the state of other
nodes only when it desires to get involved in either sending or receiving tasks. Because their
actions are dependent on the status of the system, demand-driven policies are inherently adaptive
and dynamic. The policy here can be sender initiative : sender looks for receivers to transfer the
load, receiver initiated – receivers solicit load from the senders and symmetrically initiated – a
combination of both sender & receiver initiated.
Periodic –
At regular intervals, nodes exchange data. To inform localization algorithms, each site will have
a significant history of global resource utilization over time. At large system loads, the benefits
of load distribution are negligible, and the periodic exchange of information may thus be an
unnecessary overhead.
State – change – driven –
When a node’s state changes by a specific amount, it sends out state information. This data
could be forwarded to a centralized load scheduling point or shared with peers. It does not collect
information about other nodes like demand-driven policy. This policy does not alter its
operations in response to changes in system state. For example, if the system is already
overloaded, exchanging system state information on a regular basis will exacerbate the problem.
You
selecting a suitable load sharing algorithm, requirements for load distributing, task migration and
associated issues
ChatGPT
ChatGPT
Selecting a suitable load-sharing algorithm and designing an effective load-distributing system
involves considering various factors and requirements. Additionally, task migration plays a
crucial role in load distribution, but it introduces its own set of challenges. Here's a breakdown of
considerations for selecting a load-sharing algorithm, requirements for load distribution, and
associated issues with task migration:
Selecting a Load-Sharing Algorithm:
System Characteristics:
Consider the characteristics of the distributed system, including the number of nodes, their
capabilities, and the communication infrastructure. Some algorithms may be better suited for
homogeneous environments, while others are designed for heterogeneous systems.
Task Granularity:
Assess the nature of the tasks or workloads to be distributed. Fine-grained tasks may benefit
from algorithms that minimize communication overhead, while coarse-grained tasks may be
more suitable for algorithms that prioritize load balancing.
Communication Overhead:
Evaluate the communication overhead introduced by the load-sharing algorithm. Efficient
algorithms should minimize unnecessary communication between nodes to avoid latency and
ensure effective load balancing.
Adaptability:
Choose algorithms that can adapt to dynamic changes in the system, such as varying workloads,
node failures, or additions/removals of nodes. Adaptive algorithms can provide more robust load
distribution.
Load Prediction:
Consider algorithms that incorporate load prediction mechanisms. Predictive algorithms can
anticipate changes in workload and make proactive load distribution decisions to prevent
imbalances.
Scalability:
Assess the scalability of the algorithm to ensure it can handle an increasing number of nodes and
tasks without introducing bottlenecks or degrading performance.
Fault Tolerance:
Evaluate the algorithm's ability to handle node failures and maintain load balance in the presence
of faults. Fault-tolerant load-sharing mechanisms should redistribute tasks to healthy nodes.
Global vs. Local Knowledge:
Decide whether the algorithm requires global knowledge of the entire system or can operate with
local knowledge limited to information about neighboring nodes. The choice impacts the
complexity and efficiency of the algorithm.
Requirements for Load Distribution:
Load Balancing Policies:
Define load balancing policies based on the goals of the system. Policies may include
minimizing variance in node workloads, reducing response time, optimizing resource utilization,
or achieving specific performance metrics.
Communication Mechanism:
Establish efficient communication mechanisms between nodes. The communication protocol
should facilitate the exchange of information about current load and task execution status.
Adaptability to Workload Changes:
Ensure the load distribution system can adapt to changes in workload patterns. This involves the
ability to dynamically adjust task assignments in response to variations in computational
demands.
Dynamic Workload Management:
Implement mechanisms for dynamically managing workloads, including load shedding (if
applicable) during peak periods and redistributing tasks during periods of low activity.
Task Migration and Associated Issues:
Task Granularity and Overhead:
Determine the appropriate granularity for migrating tasks. Fine-grained migrations may incur
more overhead due to communication costs, while coarse-grained migrations may lead to longer
response times.
Communication Latency:
Task migration introduces communication latency as tasks are transferred between nodes.
Minimizing latency is crucial for maintaining system responsiveness.
Consistency and Coherence:
Ensure the consistency and coherence of data when migrating tasks. Synchronize data between
source and destination nodes to prevent inconsistencies and maintain a coherent state.
Impact on Performance:
Evaluate the impact of task migration on overall system performance. Excessive migration may
introduce overhead and negate the benefits of load balancing.
Fault Tolerance in Migration:
Implement fault-tolerant mechanisms for task migration to handle potential failures during the
migration process. This involves ensuring that tasks can be rolled back or resumed in case of
unexpected events.
Resource Constraints:
Consider resource constraints during task migration, such as memory limitations and network
bandwidth. Migrating tasks should not overwhelm the resources of the destination node.
Dynamic Adaptation:
Design task migration mechanisms that dynamically adapt to changes in the system, such as
node failures or additions. The migration system should seamlessly adjust to maintain load
balance.
Energy Efficiency:
Assess the energy efficiency implications of task migration. Minimizing unnecessary migrations
can contribute to energy savings, especially in resource-constrained environments.
In summary, selecting a suitable load-sharing algorithm involves considering system
characteristics, communication overhead, adaptability, and other factors. Load distribution
requirements include defining policies, managing dynamic workloads, and ensuring efficient
communication. Task migration introduces challenges related to granularity, latency,
consistency, and fault tolerance, and these issues must be carefully addressed to optimize overall
system performance.
Concurrency control means that multiple transactions can be executed at the same time and then
the interleaved logs occur. But there may be changes in transaction results so maintain the order
of execution of those transactions.
During recovery, it would be very difficult for the recovery system to backtrack all the logs and
then start recovering.
Recovery with concurrent transactions can be done in the following four ways.
Interaction with concurrency control
Transaction rollback
Checkpoints
Restart recovery
Interaction with concurrency control :
In this scheme, the recovery scheme depends greatly on the concurrency control scheme that is
used. So, to rollback a failed transaction, we must undo the updates performed by the transaction.
Transaction rollback :
In this scheme, we rollback a failed transaction by using the log.
The system scans the log backward a failed transaction, for every log record found in the log the
system restores the data item.
Checkpoints :
Checkpoints is a process of saving a snapshot of the applications state so that it can restart from
that point in case of failure.
Checkpoint is a point of time at which a record is written onto the database form the buffers.
Checkpoint shortens the recovery process.
When it reaches the checkpoint, then the transaction will be updated into the database, and till
that point, the entire log file will be removed from the file. Then the log file is updated with the
new step of transaction till the next checkpoint and so on.
The checkpoint is used to declare the point before which the DBMS was in the consistent state,
and all the transactions were committed.
To ease this situation, ‘Checkpoints‘ Concept is used by the most DBMS.
In this scheme, we used checkpoints to reduce the number of log records that the system must
scan when it recovers from a crash.
In a concurrent transaction processing system, we require that the checkpoint log record be of the
form <checkpoint L>, where ‘L’ is a list of transactions active at the time of the checkpoint.
A fuzzy checkpoint is a checkpoint where transactions are allowed to perform updates even
while buffer blocks are being written out.
Restart recovery :
When the system recovers from a crash, it constructs two lists.
The undo-list consists of transactions to be undone, and the redo-list consists of transaction to be
redone.
The system constructs the two lists as follows: Initially, they are both empty. The system scans
the log backward, examining each record, until it finds the first <checkpoint> record.