Ncache is a caching system based on the NGINX WEB Server model component, which is an open source product of Sina company.
In this paper, the Ncache 3.xhttp://www.aliyun.com/zixun/aggregation/9942.html "> Technical framework for detailed description, so that the technical framework has a deeper understanding.
Ncache was first developed as an HTTP module for Nginx, as it was hoped to achieve better compatibility and scalability as an independent module that could be better promoted and used, Installation will also be convenient. But then with the increase in code, the expansion of the function, Nginx's original module framework is not very good to meet the needs, so the Nginx kernel code is extracted, and the cache part of the embedded, formed the Ncache.
1. Overall structure
2.HASH Index Structure
1. All data is calculated by hash to which entry should be evenly distributed.
2.ENTRY actually store only one index of the subscript value and a mutex, so you can compress the first layer of the hash table occupy space, avoid the hash table space waste, now all index about occupy 700MB space
3. Information related to cached data is stored in each index: when expires (cached storage time + Max-age value, each cache hit with the current time compared to this time), data length, whether it is compressed data, UTF-8 format, etc.
4.INDEX is responsible for pointing to the first index block (for allocation) that is idle in the index list and the last index block (for recycling) that is idle in the index list so that you can use different locks for allocation and recycling to control the reduction of conflict elevation efficiency
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.