Is there any waiting time for messages in the server before serve it? I dont mean (TTL), I mean the messages reach the server ( how long should wait before getting serve)?
Could you be more precise. What do you mean: the messages reach the server ?
Typical server can be modeled as a service point with queue (see for example queueing theory) where for simplicity we have First In First Out regime for serving successive requests. If there are no other waiting requests our one should be served as the first one (there is a need a some amount of time for the results of this request called Service Time); if there are other requests we are forced to wait in queue (this is called Waiting Time) until other request will be served. A sum of Service Time and Waiting Time gives us the Response Time. Waiting time depends on other requests, Service Time depends on the server. Se for example paper:
Your question is the basis of queueing theory that has been set up more than a century ago, in particular in telecommunications systems. There is a huge body of work on this matter that was introduced by A.K. Erlang (which the telecom unit is based upon).
Indeed, A.K. Erlang published a paper in 1917 entitled "Solution of some Problems in the Theory of Probabilities of Significance in Automatic Telephone Exchanges".
This paper introduces his classic formulae for call loss (Erlang Loss Formula) and waiting time. It has been used for long for calculated the number of circuits in telephone networks to be installed for meeting the demand with some predefined performance (Grade of Service). Such result have been extended more widely to computer networks and servers, for different arrival processes and also for various service time distribution.
Obviously, this approaches are valid beyond computer network systems.
So maybe yous should refer to classical books on queuing theory and/or applied probability.
thank you very much for your answer. So the waiting time in the server, who is determined ? company? is that mean each device ( router, server, have different waiting time set up by comapnay)??
The waiting time is a result of the the demand (requests by users), service time (time taken by the server to handle a request) and the number of positions in the queue. They are not set by a company.. but they exist for almost any type of device that queue requests (think of a bus station, or a csasier in a shop).
As told, there exist some formulae to estimate the waiting time according to statistical properties of service and arrival processes, but also according to queue serving disciplines (e.g. First in first out (FIFO) or others). These outcome result from the mathematical findings in Applied probability in the 19th century and the pioneering work from A.K. Erlang early 20th century.
When servers are not enough to have low waiting times, it might be appropriate to add some servers so parallel processing can be achieved.
There are a number of book dealing with such problems. See the famous books by L. Kleinrock, Queueing Systems Vol. I and II), Wiley, 1975 or more recently T. Bonald and M. Feuillet, Network Performance Analysis, Wiley, 2011.