Hi, Just want to know, do I need to add -enable parameter when running configure? This is the final enabled list I get, seems there's no mod_cache. I don't know if it's enabled or not. enabled: mod_access mod_accesslog mod_alias mod_auth mod_cgi mod_compress mod_dirlisting mod_evhost mod_expire mod_extforward mod_fastcgi mod_flv_streaming mod_indexfiles mod_mysql_vhost mod_proxy mod_redirect mod_rewrite mod_rrdtool mod_scgi mod_secdownload mod_setenv mod_simple_vhost mod_ssi mod_staticfile mod_status mod_trigger_b4_dl mod_userdir mod_usertrack mod_webdav disabled: mod_magnet
On Wed, Nov 4, 2009 at 11:51 AM, shellcode <shellc...@gmail.com> wrote:
> mod_cache isn't in official lighttpd distribution, you need to patched
> lighttpd source from http://code.google.com/p/lighttpd-improved/
yeah, that's the version I'm using. It seems I still can't get memory cache enabled. I enabled debug, and my configuration now looks like below
cache.max-memory-size = 256
cache.debug = "enable"
cache.refresh-pattern = ("^[\s\S]+$" => "21600 use-memory")
And nothing is in /var/log/lighttpd/error.log
I asked this question like 2 weeks ago if you still remember. I also read your blog about what situations can't mod_cache work. But my server is just a static image server with about 2000000 small images (15kb in average). The HTTP headers are correctly set, and no back end server running.
I ran an http_load stress testing with 100 sessions,180 seconds, and access for like 3000 sample image, which takes at least 45M memory in total. However, in htop, lighttpd takes always about 60M memory, no change at all. I think memory cache is not working properly. Any ideas?
Is it possible that some modules maybe conflicting with mod_cache?
I have the following modules enabled:
mod_cache
mod_rewrite
mod_access
mod_expire
mod_accesslog
and configured with
--with-fam
--with-ssl
Regards,
YX
no mod_proxy. it's a image server that only serves static images.
And here is the curl result:
> GET /ProductImages/sku_0005_1.jpg HTTP/1.1
> User-Agent: curl/7.15.5 (x86_64-redhat-linux-gnu) libcurl/7.15.5 OpenSSL/0.9.8b zlib/1.2.3 libidn/0.6.5
> Host: 75.126.135.148
> Accept: */*
>
< HTTP/1.1 200 OK
< Expires: Fri, 04 Dec 2009 08:30:21 GMT
< Cache-Control: max-age=2592000
< Content-Type: image/jpeg
< Accept-Ranges: bytes
< ETag: "3213402665"
< Last-Modified: Sun, 18 Oct 2009 12:05:40 GMT
< Content-Length: 11345
< Date: Wed, 04 Nov 2009 08:30:21 GMT
< Server: lighttpd/1.4.23-devel-42M
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 11345 100 11345 0 0 6307 0 0:00:01 0:00:01 --:--:-- 7108Connection #0 to host 75.126.135.148 left intact
On Thu, Nov 5, 2009 at 9:16 AM, 任晓磊 <julycl...@gmail.com> wrote:
> I think operating system should cache frequently accessed files into
> memory, lighty does not need to control it. Am I right?
> 2009/11/4 shellcode <shellc...@gmail.com>:
>> mod_cache is to cache remote files to local disk/memory, so mod_proxy is
>> needed for mod_cache.
>> mod_mem_cache is to cache local files into memory
> On Thu, Nov 5, 2009 at 9:16 AM, 任晓磊 <julycl...@gmail.com> wrote:
>> I think operating system should cache frequently accessed files into
>> memory, lighty does not need to control it. Am I right?
>> 2009/11/4 shellcode <shellc...@gmail.com>:
>>> mod_cache is to cache remote files to local disk/memory, so mod_proxy is
>>> needed for mod_cache.
>>> mod_mem_cache is to cache local files into memory
OS try to cache every files recently accessed into memory, then OS will drop some cached files at any time. mod_mem_cache/mod_cache caches files that are useful for web service only.
In summary, sometimes OS cache isn't good enough for faster web service and application cache works good enough
Should application cache open files with NO CACHE flags to inform OS not to cache it? Or else, there would be two copies in memory, one is app's ,the other is OS's.
> OS try to cache every files recently accessed into memory, then OS will drop > some cached files at any time. > mod_mem_cache/mod_cache caches files that are useful for web service only. > In summary, sometimes OS cache isn't good
when one file is cached in application, then there has no disk read access to it for long time, so OS will remove it from cache soon for caching other files.
On Thu, Nov 5, 2009 at 11:42 AM, 任晓磊 <julycl...@gmail.com> wrote:
> Should application cache open files with NO CACHE flags to inform OS > not to cache it? > Or else, there would be two copies in memory, one is app's ,the other is > OS's.
Hi again, I tried mod_mem_cache, it works fine. But I also noticed that expires header is removed. I'm not sure yet whether it's because of lighttpd upgrading or mod_mem_cache patch. is there any known issue of mod_mem_cache?
> Hi again, > I tried mod_mem_cache, it works fine. But I also noticed that expires > header is removed. I'm not sure yet whether it's because of lighttpd > upgrading or mod_mem_cache patch. is there any known issue of > mod_mem_cache?