I always wonder how a server like google server receive thousands of request from people at once! I understand the signals are passed through fibernet cable, but won’t those signals collide ? Or how can some small wire handle soo many requests at once ? iin my mind a wire can only take one request at a time. I know these happens close to light speed, but still! its very hard to understand.
In: Technology
Package can collide: yup! That’s a thing (don’t ask me the technical details, my guess is they may read the data line at the same time to double check?)
How a wire can transfer so much data?
One part is how fast you can switch on/off that light switch. If the light takes 1sec to open, that limit your bandwidth.
The other is finding way to send multiples data at once. For example, what if you send a green signal, and me a red? Our signal will collide, but if the output see color to split them into different signal.
I think what they actually does is sending the signal with some angle. As per, you would typically send light straight in the fiber, instead, they send one like at 45 degree, another one at 15, …. (Warning that was random numbers).
On the computer side (network switch, or computer) they use tricks like DMA (direct memory attached). Aka, the fiber receiver can talk to the memory (RAM) directly. So the CPU, just have to take whatever it needs when it needs it.
Then DNS can provide a list of IPs to your computer, which takes one randomly – that can help with balancing the traffic to multiple servers.
You have load balancers that can do similar things internally (but I’m still curious how you can do that on a big scale, that makes no sense one could do that much, even if it does just proxy traffic).
Each step further can then use their own load balancer/DNS for inner resources, including dedicated sub servers.
On a side note for server, you may know CPU for consumers can go like up to 12 cores, for servers (your typical webserver at least), it can go like 64 cores (probably even more?). So, 64 simultaneously request.
Keep in mind, a lot of processing is also waiting, waiting the data to come from RAM, hardware, network (database), …
So you don’t necessarily need a lot of processing (for your typical webserver).
Latest Answers