Your SlideShare is downloading. ×
  • Like
What is ncache?
Upcoming SlideShare
Loading in...5
×

Thanks for flagging this SlideShare!

Oops! An error has occurred.

×

Now you can save presentations on your phone or tablet

Available for both IPhone and Android

Text the download link to your phone

Standard text messaging rates apply

What is ncache?

  • 2,998 views
Published

a web cache system base on nginx web server. faster and more efficient than squid. …

a web cache system base on nginx web server. faster and more efficient than squid.

Features
The large storage can save over 30,000,000 caches
The self sort share memory hash index
Use linux epoll, sendfile and aio to improve the performance
Base on the fastest web server framework : nginx
The high throughput and high concurrent volume of the cache request
Without http headers cache
Low cpu cost and low iowait
Memory cache the hottest data use HAC
Aio queue with lio_listio function

http://www.ncache.org/

Published in Technology , Self Improvement
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Be the first to comment
No Downloads

Views

Total Views
2,998
On SlideShare
0
From Embeds
0
Number of Embeds
0

Actions

Shares
Downloads
44
Comments
0
Likes
1

Embeds 0

No embeds

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
    No notes for slide

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. STRUCTURE Be proxy hash index Init by Ngx master process when nginx is start on Ngx worker process Ngx worker process Disk Files Read / write by file system or raw dev Backend server Backend server Backend server Body filter Get the proxy content and save into the disk by aio
  • 4. Logic Diagram Request Request Find cache in index found Not found Timeout? not yes Sendfile output Proxy backend Body filter Writev output Aiowrite fresh index
  • 5. The self sort share mem hash index 2(5) 3(4) First floor of hash index List to solve the conflict of the hash Hash_malloc 1(6) Index[1]+2 = 7 1(6) 3(4) 2(7) Top:0 16777216 33554432 If arrived at the bottom of the share memory then ncache will return to the 16777216 point and find which can be reused
  • 6. Record lock Mmap auto sync Mem index Sync file Worker process Worker process Read Write Worker process Do not need to lock any worker process or request cause wait not cause wait not cause wait
  • 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:
      • [email_address]
      • [email_address]