简体   繁体   中英

Caching on Nginx for Windows 7?

We're using nginx as a local proxy on a number of deployed sites. We're trying to add caching, but it appears that this isn't supported on windows ( http://nginx.org/en/docs/windows.html#known_issues ).

The problem seems to be with shared memory support; which is used to allow very fast cache key lookup. In our situation, we have a small number of clients connecting through the proxy to download some large files. We don't need very fast cache key lookup.

Is there any way to tell nginx not to use shared memory for its cache key lookup?

Thanks, Alastair

(ps we have limited control over the target deploy, so we cannot run a linux version, even within a vm. It has to be a windows app)

If your cache key set is relatively limited and not dynamic, you can try to turn proxy cache on recent Nginx and increase keys_zone size to be large enough to contain the key set. On some machines you may need to turn off ASLR (eg with EMET ) but from experience it may work as is.

See https://stackoverflow.com/a/40965027/3624545 for limits and behavior.

Do stress test for desired key set with HIT/MISS monitoring eg

log_format cachelog '$upstream_cache_status "$request" $status';
access_log logs/access_cache.log cachelog;

to ensure it is working properly, does not crash or consume more memory than expected.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM