1 / 10

NCACHE

NCACHE. The fast web cache server base on nginx Use aio sendfile and epoll modules The self sort share mem hash index High performance and large storage Low cpu cost and low iowait Record lock instead of process lock Without http headers cache. OVERVIEW. F5. NGINX PROXY. NCACHE.

jace
Download Presentation

NCACHE

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. NCACHE • The fast web cache server base on nginx • Use aio sendfile and epoll modules • The self sort share mem hash index • High performance and large storage • Low cpu cost and low iowait • Record lock instead of process lock • Without http headers cache

  2. OVERVIEW F5 NGINX PROXY NCACHE BACKEND BACKEND BACKEND

  3. Ngx worker process Ngx worker process hash index Init by Ngx master process when nginx is start on Disk Files Read / write by file system or raw dev Body filter Be proxy Get the proxy content and save into the disk by aio Backend server Backend server Backend server STRUCTURE

  4. Request Request Not found Find cache in index found yes Timeout? not Proxy backend Sendfile output Body filter Writev output Aiowrite fresh index Logic Diagram

  5. The self sort share mem hash index First floor of hash index 1(6) Top:0 List to solve the conflict of the hash 2(5) Index[1]+2 = 7 3(4) 2(7) 16777216 1(6) Hash_malloc 3(4) If arrived at the bottom of the share memory then ncache will return to the 16777216 point and find which can be reused 33554432

  6. Record lock Sync file Read Mem index Worker process Do not need to lock any worker process or request Mmapauto sync not cause wait Worker process cause wait Write not cause wait Worker process

  7. Performance between SQUID 1 First: cpu last: io Blue is ncache

  8. Performance between SQUID 2 SQUID NCACHE

  9. Future • The aio_sendfile function • Compress share memory hash index • Memory cache the hottest data • Raw device read and write • Distribute storage system • Aio queue with lio_listio function

  10. The end • Google code: • http://code.google.com/p/ncache/ • Nginx wiki: • http://wiki.codemongers.com/ • Our mail: • pangfan@staff.sina.com.cn • shuiyang@staff.sina.com.cn

More Related