D
D
Dimonchik2015-12-30 16:44:05
Nginx
Dimonchik, 2015-12-30 16:44:05

How to organize a cache in the server's memory to return static from the HDD?

Used by nginx to serve images. Pictures are both preview and full size. You don't need to compress on the fly, everything is already cut.
The server has two HDDs of 500 Gb and 64 Gb of memory.
They write that for nginx, 16 Gb of memory is enough for such a task (well, a maximum of 32 Gb), but due to the presence of many small files, with an increase in the number of visitors, performance will rest on disk I / O.
It is recommended to organize the return of the most visited from the cache. Since there is a lot of memory, this is advisable.
As a rule, memcached is offered as a cache, with the note that nginx cannot write to it.
All examples describe LAMP / LEMP configurations and objects in memcached, respectively, PHP lays down, and Nginx only reads.
I don't use PHP on the server. And I want to use the memory.
Another recommendation is Varnish , it is hung on port 80, in front of / or behind nginx, and configured to cache everything given. But - according to Varnish, the reviews are twofold, there is an opinion that Nginx gives statics quite well, and Varnish is not able to improve this, but what about disk I / O then?
Tell me, is it worth using Varnish, or is it still classic Memcached, but how to manage it then?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
P
Puma Thailand, 2015-12-30
@dimonchik2013

it is extremely doubtful that you have run into the file subsystem, it’s easier to pick up the nginx settings for impact, and not toil with nonsense. Linux itself will put frequently requested pictures into memory without the participation of nginx and you.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question