Question

In: Computer Science

Consider a client-application that collects and computes the average of an integer (eg. stock price/value) collected...

Consider a client-application that collects and computes the average of an integer (eg. stock price/value) collected from a number (eg 20) remote servers.

Question 1.

Determine how long time it will take the client to deliver an answer to its user, assuming serial requests to each server, and 1) an average response time of 200 ms, 2) 10 ms, and  3) 1 ms.

Question 2.

Compare this to the situation where all values are present in the local memory of the client.

Question 3.

What consequences does that have on the information that one computer of a distributed systems knows about the others?

Question 4.

What consequence does it have on the way we design a distributed system, and make use of remote access?

Solutions

Expert Solution

1. Assuming the worst case 200 ms for each server if we execute the REST API - jersey or rxnetty aynchronous non blocking api call in parallel - 4 threads since a processor has 4 cores at minimum - 20 remote servers / 4 threads => 5 servers / Thread

Each thread takes => 200 ms * 5 => 1000 ms => 1 second response times for 5 servers in each thread.

Together 4 threads we have -> 1 second * 4 => 4 seconds .

Assuming serial requests to server -> 200 ms * 20 => 4000 ms => 4 seconds .

2. Local memory -> RAM of the client is extremely fast sub-millisecond response time if in main memory it will happen based on the disk seeks. for 1 TB harddisk it will take less than 100 ms for data fetch.

3 & 4 . In case of distributed systems - we could access the values based on rpc or remote procedure call or REST API. Get method of rest api is faster.

Issues faced:

1.Client timeouts - because network is congested with heavytraffic or remote server is busy processing other requests.

2. API Retry or 404 error - HTTP status returning error codes due to bad gateway or server is down due to main memory failure or os crashes.

3. Server Down - 99.999% has 3 days down time . Trying to access at those time will lead to server not found error.

4. DNS error - DNS cache or DNS busy trying to process more requests.

5. Service Discovery Error - The URL is not found in the load balancer routing table or entry map .


Related Solutions

Write an application that reads three integers, adds all three together and computes an average of...
Write an application that reads three integers, adds all three together and computes an average of the three entries and computes any remainder of the integer division. A remainder represents the modulus result of dividing an even by an odd number or vice versa. Display the output. Enter an integer score 3 Enter an integer score 6 Enter an integer score 4 The average of 3, 6, 4 is 4 with a remainder of 1 Press any key to continue...
Design and implement an application that reads an integer value and prints the sum of all...
Design and implement an application that reads an integer value and prints the sum of all even integers between 2 and the input value, inclusive. Print an error message if the input value is less than 2 and prompt accordingly so that the user can enter the right number. Your program file will be called YourLastNameExamQ2
Write an application named MultiplicationTable that prompts the user for an integer value, for example 7....
Write an application named MultiplicationTable that prompts the user for an integer value, for example 7. Then display the product of every integer from 1 through 10 when multiplied by the entered value. For example, the first three lines of the table might read 1×7=7 , 2×7=14 , and 3×7=21 using a Loop other than While if
Consider comparing an established technology company’s stock with an average price of $26.05 and a standard...
Consider comparing an established technology company’s stock with an average price of $26.05 and a standard deviation of $7.00 against a penny stock with an average price of $0.77 and a standard deviation of $1.00. Which stock is more volatile? Which metric shall be used to compare these two stocks (Variance, Standard Deviation, Mean, Coefficient of Variation, etc.)? Why?
Consider the following stock price and shares outstanding information. Consider the following stock price and shares...
Consider the following stock price and shares outstanding information. Consider the following stock price and shares outstanding information. DECEMBER 31, Year 1 DECEMBER 31, Year 2 Price Shares Outstanding Price Shares Outstanding Stock K $19 100,000,000 $28 100,000,000 Stock M 76 2,400,000 40 4,800,000a Stock R 44 25,000,000 49 25,000,000 aStock split two-for-one during the year. Compute the beginning and ending values for a price-weighted index and a market-value-weighted index. Assume a base value of 100 and Year 1 as...
Consider a call option on a stock, the stock price is $23, the strike price is...
Consider a call option on a stock, the stock price is $23, the strike price is $20, the continuously risk-free interest rate is 9% per annum, the volatility is 39% per annum and the time to maturity is 0.5. (i) What is the price of the option? (6 points). (ii) What is the price of the option if it is a put? (6 points) (iii) What is the price of the call option if a dividend of $2 is expected...
Consider an option on a dividend-paying stock when the stock price is $30, the exercise price...
Consider an option on a dividend-paying stock when the stock price is $30, the exercise price is $29, the risk-free interest rate is 5% per annum, the volatility is 25% per annum, and the time to maturity is four months. The present value of the dividend to be paid in 3 months is $1. (20 points) a. What is the price of the option if it is a European call? b. What is the price of the option if it...
Consider an option on a dividend-paying stock when the stock price is $30, the exercise price...
Consider an option on a dividend-paying stock when the stock price is $30, the exercise price is $29, the risk-free interest rate is 5% per annum, the volatility is 25% per annum, and the time to maturity is four months. The present value of the dividend to be paid in 3 months is $1. (20 points) a. What is the price of the option if it is a European call? b. What is the price of the option if it...
Consider an option on a non-dividend-paying stock when the stock price is $30, the exercise price...
Consider an option on a non-dividend-paying stock when the stock price is $30, the exercise price is $29, the risk-free interest rate is 5% per annum, the volatility is 25% per annum, and the time to maturity is four months. 1. What is the price of the option if it is a European call? 2. What is the price of the option if it is an American call?
Consider an option on a non-dividend-paying stock when the stock price is $40, the strike price...
Consider an option on a non-dividend-paying stock when the stock price is $40, the strike price of $38, the risk-free interest rate is 10% per annum, the volatility is 35% per annum, and the time to maturity is five months. 1. What is the price of the option if it is a European call? 2. What is the price of the option if it is a European put?
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT