Welcome! Log In Create A New Profile

Advanced

Re: Nginx Caching strategy

Maxim Dounin
October 05, 2010 07:36AM
Hello!

On Mon, Oct 04, 2010 at 03:12:57PM -0400, cachenewbie wrote:

> All - Is there a high level tutorial on how nginx does caching ? Does

Some information is available here (in Russian):

http://sysoev.ru/nginx/docs/http/ngx_http_proxy_module.html#proxy_cache_path

Translation is available here (looks like correct one, but I
haven't really checked):

http://wiki.nginx.org/NginxHttpProxyModule#proxy_cache_path

> it use mmap to map the cache directory/file into memory and share it
> with all nginx worker processes (and use sendfile to send it out to the
> socket) ? Or does it use directIO to open the file and use regular
> read/write syscalls ? This is for Linux debian platform.

nginx just saves responses to disk under the distinct names
(derived from cache key), with headers at start. When reading
from cache, nginx uses regular read() (or aio if available and
switched on) to read headers and normal file sending mecachnism to
send body.

"Normal file sending mechanism" implies sendfile, aio, directio
and so on - if available and configured.

Some metainformation about cache contents (to count cache
accesses, remove old files and so on) are stored in shared memory.

Maxim Dounin

_______________________________________________
nginx mailing list
nginx@nginx.org
http://nginx.org/mailman/listinfo/nginx
Subject Author Posted

Nginx Caching strategy

cachenewbie October 04, 2010 03:12PM

Re: Nginx Caching strategy

cachenewbie October 04, 2010 03:55PM

Re: Nginx Caching strategy

valor October 08, 2010 08:08AM

Re: Nginx Caching strategy

Maxim Dounin October 05, 2010 07:36AM

Re: Nginx Caching strategy

cachenewbie October 13, 2010 10:17AM

Re: Nginx Caching strategy

Ryan Malayter October 13, 2010 09:54PM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 173
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready