问题
Time and again when I search for a topic on Google, Google returns me the results and also prints out some stats like
"Results 1 - 10 of about 8,850,000 for j2me. (0.24 seconds)"
I notice that the seconds taken by Google to serve the results are in fraction of a second range.
How does Google serve pages so fast, what kind of database optimization tricks has it used at its end?
回答1:
I think the main reason for the frontend performance are:
- Each request is distributed to a series of machines in parallel (I have read somewhere that each query hits around 12 machines), probably a single machines gathers the responses from these machines
- All index data are held in RAM. With index data, I mean the term vocabulary and the postings list index and in the case of Google probably a lot more indexes e.g. for spelling corrections. Even with a single disk I/O somewhere the latency of the disk seek prevents such a performance.
Googles Map/Reduce, GFS are great tools for background processing, but they have nothing to do with the frontend performance.
回答2:
Map and Reduce + huge distributed datacenter.
来源:https://stackoverflow.com/questions/1298860/how-does-google-serve-results-so-fast