You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@httpd.apache.org by Julius Thyssen <ju...@gmail.com> on 2007/07/08 22:24:30 UTC

[users@httpd] Re: mod_deflate optimization

Actually, when I try to use itlike this:

<Location />

SetOutputFilter DEFLATE
BrowserMatch ^Mozilla/4 gzip-only-text/html
BrowserMatch ^Mozilla/4\.0[678] no-gzip
BrowserMatch \bMSIE !no-gzip !gzip-only-text/html
SetEnvIfNoCase Request_URI\.(?:gif|jpe?g|png|wav|mp3|ogg|bmp|avi|mpg)$
no-gzip dont-vary
Header append Vary User-Agent env=!dont-vary
DeflateCompressionLevel 5
DeflateMemLevel 9
DeflateWindowSize 14

</Location>

I get:

"DeflateCompressionLevel not allowed here"

and httpd won't start.

Anyone care to explain what kind of permissions are involved here?
Should I point <Location /> to only the webdir I want to use deflate
for, and if so, how do I make it allowed there?

Thanks

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] Re: mod_deflate optimization

Posted by Vincent Bray <no...@gmail.com>.
On 09/07/07, Julius Thyssen <ju...@gmail.com> wrote:
> http://httpd.apache.org/docs/2.0/mod/mod_deflate.html
> shows an example almost identical to what I'm using,
> with <Location tags. Not very indicative of your advice,
> I would say. ;-)

That example doesn't include DeflateCompressionLevel :-)

> I don't remember, but someone on the web, long ago,
> advised me to use mod_deflate just to speed things up.
> This may be versions ago, but I'm switching it off right now.

It might well do, but it's a tradeoff between slightly increased CPU
usage and smaller responses to the client. Clients on slow connections
will likely see an increased responsiveness on your site.

> I see I'm also loading
> mod_cache
> mod_disk_cache
> mod_mem_cache
>
> Is there any way to make more use of these?
> Less disk-reads, more memory caching perhaps
> could speed up page-loading for my server.
> But I just read another post in this list,
> claiming the linux kernel already mem-caches everything.

See:

http://httpd.apache.org/docs/2.2/caching.html
http://www.mnot.net/cache_docs/

mod_cache implements a http cache so requires that your php pages send
appropriate headers to indicate cacheability and time-to-live. It'll
certainly be a good speed increase, but only for those pages which can
be cached, eg those which are identical regardless of the client over
a period of time. Anything that requires a login generally can't be
cached in this manner. For that scenario there are caching engine
specific to the php module which allow it to speed up script parsing
etc.

Of course you shouldn't attempt to optimise your server without having
some kind of benchmark to tell you if your changes are having any
effect. Apache bundles one such tool, the 'ab' command, and there are
several others available on the 'net.

-- 
noodl

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] Re: mod_deflate optimization

Posted by Julius Thyssen <ju...@gmail.com>.
On 7/9/07, Vincent Bray <no...@gmail.com> wrote:

> See the docs for that directive which include:
>
> Context:        server config, virtual host
>
> Meaning that this directive can be set in the main server context, or
> <VirtualHost, but not in a container like <Location or <Directory.

http://httpd.apache.org/docs/2.0/mod/mod_deflate.html
shows an example almost identical to what I'm using,
with <Location tags. Not very indicative of your advice,
I would say. ;-)

> As for your original post, if you don't have an issue with bandwidth
> but otherwise want to speep up your site, are you sure adding the
> overhead of compression is wise?

I don't remember, but someone on the web, long ago,
advised me to use mod_deflate just to speed things up.
This may be versions ago, but I'm switching it off right now.

I see I'm also loading
mod_cache
mod_disk_cache
mod_mem_cache

Is there any way to make more use of these?
Less disk-reads, more memory caching perhaps
could speed up page-loading for my server.
But I just read another post in this list,
claiming the linux kernel already mem-caches everything.

Thanks for any and all advice.


Julius

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] Re: mod_deflate optimization

Posted by Vincent Bray <no...@gmail.com>.
On 09/07/07, Julius Thyssen <ju...@gmail.com> wrote:
> Actually, when I try to use itlike this:
>
> <Location />
>
> SetOutputFilter DEFLATE
> BrowserMatch ^Mozilla/4 gzip-only-text/html
> BrowserMatch ^Mozilla/4\.0[678] no-gzip
> BrowserMatch \bMSIE !no-gzip !gzip-only-text/html
> SetEnvIfNoCase Request_URI\.(?:gif|jpe?g|png|wav|mp3|ogg|bmp|avi|mpg)$
> no-gzip dont-vary
> Header append Vary User-Agent env=!dont-vary
> DeflateCompressionLevel 5
> DeflateMemLevel 9
> DeflateWindowSize 14
>
> </Location>
>
> I get:
>
> "DeflateCompressionLevel not allowed here"
>
> and httpd won't start.
>
> Anyone care to explain what kind of permissions are involved here?
> Should I point <Location /> to only the webdir I want to use deflate
> for, and if so, how do I make it allowed there?

See the docs for that directive which include:

Context:	server config, virtual host

Meaning that this directive can be set in the main server context, or
<VirtualHost, but not in a container like <Location or <Directory.

As for your original post, if you don't have an issue with bandwidth
but otherwise want to speep up your site, are you sure adding the
overhead of compression is wise?

Also, I expect your SetOutputFilter is too general and may end up
having apache try in vain to compress image files.

-- 
noodl

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org