Nginx-0.8.11

Changes with nginx 0.8.11 28 Aug
2009

*) Change: directive "gzip_disable msie6" enables gzipping for
   MSIE 6.0 SV1.

*) Feature: file AIO support on FreeBSD and Linux.

*) Feature: the "directio_alignment" directive.

On Fri, Aug 28, 2009 at 05:40:39PM +0400, Igor S. wrote:

Changes with nginx 0.8.11 28 Aug 2009

*) Change: directive "gzip_disable msie6" enables gzipping for 
   MSIE 6.0 SV1.

*) Feature: file AIO support on FreeBSD and Linux.

*) Feature: the "directio_alignment" directive.

FreeBSD settings:

location /video/ {
sendfile off;
aio on;
}

Linux settings:

location /video/ {
aio on;

directio             512;
# 4K alignment for XFS
#directio_alignment  4k;

output_buffers       1 128k;

}

More cool features! Thanks Igor :slight_smile: A couple questions below

2009/8/28 Igor S. [email protected]:

Changes with nginx 0.8.11 Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â 28 Aug 2009

  *) Change: directive “gzip_disable msie6” enables gzipping for
   MSIE 6.0 SV1.

Do you mean “disables” ?

  *) Feature: file AIO support on FreeBSD and Linux.

I assume AIO is better than sendfile, so in any case it would be best to
use it?

  *) Feature: the “directio_alignment” directive.

How should this directive should be tuned?

On Fri, Aug 28, 2009 at 09:10:44AM -0700, Michael S. wrote:

More cool features! Thanks Igor :slight_smile: A couple questions below

2009/8/28 Igor S. [email protected]:

Changes with nginx 0.8.11 š š š š š š š š š š š š š š š š š š š š28 Aug 2009

š š*) Change: directive “gzip_disable msie6” enables gzipping for
š š š MSIE 6.0 SV1.

Do you mean “disables” ?

No, now “gzip_disable msie6” disables MSIE4/5 and 6 before SV1.
Early it disables any MSIE4/5/6.

š š*) Feature: file AIO support on FreeBSD and Linux.

I assume AIO is better than sendfile, so in any case it would be best to use it?

It depends. On Linux AIO can be used with DIRECTIO only, which disables
caching on VM. On FreeBSD I plan to add support for sendfile()s
SF_NODISKIO
flag. This allows to use sendfile() and AIO preload for sendfile().

š š*) Feature: the “directio_alignment” directive.

How should this directive should be tuned?

By default directio_alignment is 512, however, on XFS you may need to
set “directio_alignment 4k” or even more depending on FS block size.

On Fri, Aug 28, 2009 at 05:40:39PM +0400, Igor S. wrote:

Changes with nginx 0.8.11 28 Aug 2009

*) Change: directive "gzip_disable msie6" enables gzipping for 
   MSIE 6.0 SV1.

*) Feature: file AIO support on FreeBSD and Linux.

*) Feature: the "directio_alignment" directive.

The attached patch fixes memcached broken in this release.

On Fri, Aug 28, 2009 at 09:39:20AM -0700, Michael S. wrote:

I think when they did benchmarks for Lighttpd, AIO was the fastest
solution. Is there any benefit to caching in VM? Files requested a lot
or small files?

If you have enough memory to cache hot content in VM, than nginx can
handle it without delay since nginx will not block on disk if AIO is
used.

By default directio_alignment is 512, however, on XFS you may need to
set “directio_alignment 4k” or even more depending on FS block size.

Is there an easy way to check blocksize? I use XFS typically.

Look for sectsz and bsize in xfsinfo.

Try to enable just directio without aio and request a file.
If you will see “Invalid argument” in error_log, then try to set
directio_alignment to sectsz or bsize. If the error will remain try
to double max of sectsz/bsize. Please report your results.

Also, since this is DIRECTIO, this is not really a good idea over NFS
right? I think I saw in the Linux kernel that DIO support in NFS was
experimental etc. but I’m not sure I’ll get much benefit out of it…

I do not know.

-------- Original-Nachricht --------

Datum: Fri, 28 Aug 2009 09:39:20 -0700
Von: Michael S. [email protected]
An: [email protected]
Betreff: Re: nginx-0.8.11

flag. This allows to use sendfile() and AIO preload for sendfile().

I think when they did benchmarks for Lighttpd, AIO was the fastest
solution. Is there any benefit to caching in VM? Files requested a lot
or small files?

By default directio_alignment is 512, however, on XFS you may need to
set “directio_alignment 4k” or even more depending on FS block size.

Is there an easy way to check blocksize? I use XFS typically.

Assume the device is /dev/sda1 then you could call just this one line to
get the block size:
xfs_db -c “sb 0” -c “p” /dev/sda1 | grep “^blocksize”

Or this:
echo -ne “sb 0\np\n” | xfs_db /dev/sda1 | grep “^blocksize”

Or go interactive and call:

xfs_db /dev/sda1

xfs_db> sb 0
xfs_db> p
xfs_db> quit

2009/8/28 Igor S. [email protected]:

No, now “gzip_disable msie6” disables MSIE4/5 and 6 before SV1.
Early it disables any MSIE4/5/6.

Gotcha!

It depends. On Linux AIO can be used with DIRECTIO only, which disables
caching on VM. On FreeBSD I plan to add support for sendfile()s SF_NODISKIO
flag. This allows to use sendfile() and AIO preload for sendfile().

I think when they did benchmarks for Lighttpd, AIO was the fastest
solution. Is there any benefit to caching in VM? Files requested a lot
or small files?

By default directio_alignment is 512, however, on XFS you may need to
set “directio_alignment 4k” or even more depending on FS block size.

Is there an easy way to check blocksize? I use XFS typically.

Also, since this is DIRECTIO, this is not really a good idea over NFS
right? I think I saw in the Linux kernel that DIO support in NFS was
experimental etc. but I’m not sure I’ll get much benefit out of it…

-------- Original-Nachricht --------

Datum: Fri, 28 Aug 2009 22:24:08 +0200
Von: “Steve” [email protected]
An: [email protected]
Betreff: Re: nginx-0.8.11

Early it disables any MSIE4/5/6.
solution. Is there any benefit to caching in VM? Files requested a lot

Or this:
echo -ne “sb 0\np\n” | xfs_db /dev/sda1 | grep “^blocksize”

Or go interactive and call:

xfs_db /dev/sda1

xfs_db> sb 0
xfs_db> p
xfs_db> quit

I forgot to add xfs_info. For example seeing the block size of your
mounted root file just issue this and look for bsize=nnnn
xfs_info /

A few years we went along with the buzz about writing search engine
friendly
urls. Well now I think that’s stupid and believe the site will get
crawled
regardless.

Anyway, there’s bots and ppl still looking for the sef urls so I need to
change them back.

How can I make:

/anyone-doing-late-ridei-t19640.html

into:

/showthread.php?t=19640

Perhaps not the appropriate forum… but why / where did you hear that
it
was “stupid” to do / use SEF?

Thanks

If you do that, you’re wasting SEO potential. If nothing else, the
search engines take into account textual content in your urls when
considering the topicality of the page. Without those keywords in the
url, you’ll have a harder time ranking for the relevant topics of your
site.

In Linux, is file aio + directio available when using flv streaming
module?
I mean when a transfer is started at an offset which is not multiply of
page
size.

Will be there a performance increase when serving hundrends of terabytes
of
contents?

2009/8/28 Igor S. [email protected]

On Sat, Aug 29, 2009 at 09:32:50AM +0800, 191919 wrote:

In Linux, is file aio + directio available when using flv streaming module?

Yes.

I mean when a transfer is started at an offset which is not multiply of page
size.

Small unaligned chunks on the start and the end of response are
synchronously,
while main response part is read asynchronously.

Linux AIO was developed mainly for database usage. Therefore AIO
syscalls
are really asynchronous only if a file is in DIRECTIO mode. Otherwise
the AIO syscalls are currently blocking:

This means that data read by AIO/DIRECTIO will never be cached in VM.

Besides, Linux DIRECTIO mode allows an access aligned to blocksize only.
Unaligned access returns EINVAL. It does not fallback to usual IO as
FreeBSD/Solaris do. Therefore nginx turns DIRECTIO off when it reads
small unaligned chunks on the start and the end of response. These reads
are always blocking, and probably the chunks may be even cached in VM,
but
the ending chunk can not preread during previous AIO/DIRECTIO access.

Will be there a performance increase when serving hundrends of terabytes of
contents?

I do know about about Linux. I will test it on FreeBSD only.

It’s just that it seems to put a strain on the server to redirect
everything. Maybe I’m doing it wrong. Also, when people submit content
to
bookmarks sometimes they get a redirect error. It says something like
‘this
page redirects to’ and then it won’t bookmark.

If I can make a nice clean sef that doesn’t cause problems like that
then I
would love to use it.

Also, if we move to a new platform a year or two down the line then
those
links woud need another redirect if the new system uses a different url.
Does that make sense?

Changes with nginx 0.8.11

I have updated my Ubuntu packages for 0.8.11.1 (with the memcached
patch),
they’re in my devel PPA:

https://launchpad.net/~jdub/+archive/devel

Thanks Igor!

  • Jeff

You really shouldn’t have to use redirects, I would think. A rewrite
(mod rewrite in apache, I think nginx supports similar), will allow
people to directly access the friendly urls while your application
internally receives a request for the ?something=something urls. If
rewrites are using up so much cpu that you’d rather not have search
engine traffic than have to take the cpu hit to rewrite urls…
something is seriously wrong.

Hi again Gabriel,

Thank you for your reply.

I think SEF URL’s are debatable. The more research I do the more I find
them unnecessary. It also makes it difficult for growth. What if you
change your cms, forum or whatever and the dynamic content is generated
differently? All of your “static lookalike” links are no longer valid.
I
also believe this to be true with major revisions of current cms, forums
and
other. If they do a complete code rewrite as many of them claim with
major
revisions then that might also affect urls too. Eventually you have
more
lines of rewrites and garbage in your config than anything else which is
not
the intended use. It may not strain the server but every little bit of
helps and if someone thinks they can just let that go then where does
it stop?

Anyway, here’s an old article that’s worth a read in regards to the
great
sef debate. Account Suspended

Finally, that brings me back to my original question…
Finally, that brings me to my original question…
How can I turn:
/anyone-doing-late-ridei-t19640.html

into:
/showthread.php?t=19640

====== CONFIDENTIALITY NOTICE ======
NOTICE: This e-mail message and all attachments transmitted with it may
contain legally privileged and confidential information intended solely
for
the use of the addressee. If the reader of this message is not the
intended
recipient, you are hereby notified that any reading, dissemination,
distribution, copying, or other use of this message or its attachments
is
strictly prohibited. If you have received this message in error, please
notify the sender immediately and delete this message from your system.
Thank you.

There’s no winning with you is there Gabriel… jk haha

You have a valid point there. It sucks managing over a half a million
links
on a site.

I’ll give your regex a try and see if it works in nginx.

Thanks for all your replies. :slight_smile:

Well, I coulndn’t get that to work. I’m not too good with regex stuff.

Anyone wanna give me an assist on the following?

I need
http://www.example.com/anyone-doing-late-ridei-t19640.html

to go to
http://www.example.com/showthread.php?t=19640