Welcome! Log In Create A New Profile

Advanced

Re: Image Hosting

Anonymous User
October 14, 2010 10:00AM
Thank's maxim for the clear explanation. Will try ur suggestion and will let u know.

What any information do you need to help this situation?

-----Original Message-----
From: Maxim Dounin <mdounin@mdounin.ru>
Date: Thu, 14 Oct 2010 17:46:57
To: <nginx@nginx.org>
Reply-To: nginx@nginx.org
Subject: Re: Image Hosting

Hello!

On Thu, Oct 14, 2010 at 12:26:59PM +0000, iptablez@yahoo.com wrote:

> Actually the image size is arround 100KB each. The server is running in 250Mbps traffic.
> I already described the disk I'm using is scsi 15K RPM in raid 0

Basic tunings you have to apply when serving static which doesn't
fit into memory are:

If you use sendfile:

- Make sure your OS uses appropriate read-ahead for sendfile to
avoid trashing disks with small requests (and seeks). For FreeBSD
8.1+ it should be enough to set read_ahead directive in nginx
config (0.8.18+).

http://sysoev.ru/nginx/docs/http/ngx_http_core_module.html#read_ahead
(in Russian)

Using bigger socket buffers (listen ... sndbuf=... in nginx
config) may help too.

- If serving large files - make sure you use appropriate
sendfile_max_chunk to avoid blocking nginx worker on disk for too
long.

- Consider switching sendfile off if you can't persuade it to read
large blocks from disk.

If not using sendfile:

- Tune output_buffers (again, to avoid trashing disks with small
requests and seeks). Default is 2x32k, which will result in 4
disk requests for 100k file. Changing it to 1x128k would result
in 2x memory usage but 4x less disk requests, this is probably
good thing to do if you are disk-bound.

In both cases:

- Using aio may help a lot ("aio sendfile" is only available under
FreeBSD) by adding more concurency to disk load and generally
improving nginx interactivity. Though right now it requires
patches to avoid socket leaks, see here:

http://nginx.org/pipermail/nginx-devel/2010-October/000498.html

- Using directio may help to improve disk cache effictiveness by
excluding large files (if you have some) from cache. Though keep
in mind that it disables sendfile so if you generally tune for
sendfile - you may have to apply output_buffers tunings as well.

It's hard to say anything more than this without knowing lots of
details.

Maxim Dounin

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

Image Hosting

Indo Php October 14, 2010 03:44AM

Re: Image Hosting

SplitIce October 14, 2010 03:52AM

Re: Image Hosting

Indo Php October 14, 2010 04:32AM

Re: Image Hosting

SplitIce October 14, 2010 04:36AM

Re: Image Hosting

Indo Php October 14, 2010 04:52AM

Re: Image Hosting

SplitIce October 14, 2010 05:12AM

Re: Image Hosting

Dennis Jacobfeuerborn October 14, 2010 08:28AM

Re: Image Hosting

Anonymous User October 14, 2010 08:30AM

Re: Image Hosting

Reinis Rozitis October 14, 2010 08:46AM

Re: Image Hosting

Dennis Jacobfeuerborn October 14, 2010 08:58AM

Re: Image Hosting

Anonymous User October 14, 2010 09:58AM

Re: Image Hosting

Indo Php October 14, 2010 10:30AM

Re: Image Hosting

Dennis Jacobfeuerborn October 14, 2010 11:04AM

Re: Image Hosting

Indo Php October 14, 2010 11:14AM

Re: Image Hosting

Dennis Jacobfeuerborn October 14, 2010 01:50PM

Re: Image Hosting

Anonymous User October 14, 2010 09:12PM

Re: Image Hosting

Dennis Jacobfeuerborn October 15, 2010 04:36AM

Re: Image Hosting

Ryan Malayter October 14, 2010 06:14PM

Re: Image Hosting

Anonymous User October 14, 2010 09:12PM

Re: Image Hosting

Igor Sysoev October 14, 2010 09:08AM

Re: Image Hosting

Maxim Dounin October 14, 2010 09:50AM

Re: Image Hosting

Anonymous User October 14, 2010 10:00AM

Re: Image Hosting

Indo Php October 14, 2010 10:44AM

Re: Image Hosting

SplitIce October 14, 2010 03:54AM

Re: Image Hosting

yung October 14, 2010 03:54AM

Re: Image Hosting

Igor Sysoev October 14, 2010 09:10AM

Re: Image Hosting

Anonymous User October 14, 2010 09:40AM

Re: Image Hosting

Anonymous User October 14, 2010 09:40AM

Re: Image Hosting

Anonymous User October 14, 2010 09:50AM

Re: Image Hosting

Igor Sysoev October 14, 2010 09:50AM

Re: Image Hosting

Indo Php October 14, 2010 10:58AM

Re: Image Hosting

Maxim Dounin October 14, 2010 10:10AM

Re: Image Hosting

Indo Php October 14, 2010 10:58AM

Re: Image Hosting

Maxim Dounin October 14, 2010 01:42PM

Re: Image Hosting

Anonymous User October 14, 2010 09:16PM

Re: Image Hosting

Piotr Karbowski October 14, 2010 01:44PM

Re: Image Hosting

Anonymous User October 14, 2010 09:14PM

Re: Image Hosting

Splitice October 15, 2010 01:30AM

Re: Image Hosting

Indo Php October 15, 2010 01:46AM

Re: Image Hosting

Maxime Ducharme October 26, 2010 05:42PM

Re: Image Hosting

aqjh October 27, 2010 09:52AM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 210
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