On 18/08/11 19:26, Raymond Wang wrote:
hi, all:
I am new to Squid, and I am assigned to learn how Squid manage to
memory, in order to make best use of the Squid.
there are some problems about the memory management for Squid:
1, if two files have the same content, such as two Javascript
files, then how Squid deal with the two files in memory? dose it
treat it as one file and keep the two file name somewhere?
2, how does the Squid define the level of hot data? and what is the
distribution strategy of hot data like?and How can I affect the
distribution strategy ?
Welcome to the world of caching. :)
Introducing the Squid FAQ, Knowledge Base and How-To collection:
http://wiki.squid-cache.org/
It's quite big and contains all of your answers, buried somewhere. Enjoy.
Hint:
http://wiki.squid-cache.org/SquidFaq/SquidMemory
(2) "hot" data to Squid is the set of URLs (a) currently being
transferred, plus (b) the N last requested URL objects permitted to stay
stored in RAM. cache_mem and maximum_object_size_in_memory control the
RAM cache space and object size limits.
(1) Squid deals with URLs and where to find them. That is all. Things
like the content of objects at those URLs is completely under the
control and responsibility of webmasters authoring the objects. If they
have different URLs they are different "URL objects".
(Technical warning)
Notice how I don't say file in any of the above. "file objects" is not
really the right idea to be applying if you want to understand the web
properly.
* sometimes one URL object is not a whole file object
* sometimes one URL object is multiple file objects
* sometimes the URL object can only be described as a "stream of data"
or "tunnel". Not related to the concept of "file" in any way.
* URL object size ranges from zero to infinite (inclusive).
* Sometimes multiple unique URL objects share a URL, the HTTP header
meta data then affects potential storage location as well.
On disk cacheable things may look like files. In memory they are
structured objects with snippets of HTTP headers and other meta data
attached.
Amos
--
Please be using
Current Stable Squid 2.7.STABLE9 or 3.1.14
Beta testers wanted for 3.2.0.10