I want to set up Nginx as my web server. I want to have image files cached in the memory (RAM) rather than disk. I am serving a small page and want a few images always served from RAM. I don't wish to use Varnish (or any other such tools) for this as I believe Nginx has a capability to cache contents into RAM. I am not sure as to how I can configure Nginx for this? I did try a few combinations but they didn't work. Nginx uses disk all the time to get the images.
For example, when I tried Apache benchmark to test with following command:
ab -c 500 -n 1000 http://localhost/banner.jpg
I get the following error:
socket: Too many open files (24)
I guess this means Nginx is trying to open too many files simultaneously from the disk and OS is not allowing this operation. Can anyone please suggest me a correct configuration?