Author |
|
glsmith Moderator
Joined: 16 Oct 2007 Posts: 2268 Location: Sun Diego, USA
|
Posted: Mon 03 Sep '12 22:10 Post subject: mod_mem_cache, mod_socache_memcache and 2.4 |
|
|
Admin note: splitted from http://www.apachelounge.com/viewtopic.php?p=22518#22518
Well, mod_socache_memcache is a cache provider, as all the socache modules are. All are memory based and none are a replacement for the old mod_mem_cache.
the docs wrote: | mod_socache_memcache is a shared object cache provider which provides for creation and access to a cache backed by the memcached high-performance, distributed memory object caching system. |
Basically they took the SSLCache(s) out of mod_ssl and made them into providers that other modules could use. You will notice that the types of SSLCache in 2.2.x are also in 2.4.x but there is a corresponding socache module that you must load to use that type of SSLCache in mod_ssl now.
Graham wrote a replacement for mod_mem_cache for 2.4 and it just somehow died and was never added to 2.4 nor do I think it's in trunk either.
Kanashii, have you tried mod_cache_socache?
Edit: Now that the docs at the apache.org site are working again, I took a look through the doc for mod_cache, you'll notice mod_cache_socache is mentioned in there and the doc is missing. It might be time to bug the dev list about adding this module again.
Edit2: Now that it's been split off into it's own topic, make the title more to the point. Fix an incorrect use of mod_cache_memcache.
Edit3: remove (now dead) link since mod_cache_socache is included in the standard 2.4.x release.
Last edited by glsmith on Fri 15 Nov '13 7:31; edited 5 times in total |
|
Back to top |
|
James Blond Moderator
Joined: 19 Jan 2006 Posts: 7371 Location: Germany, Next to Hamburg
|
Posted: Tue 04 Sep '12 16:56 Post subject: |
|
|
glsmith wrote: |
Edit: Now that the docs at the apache.org site are working again, I took a look through the doc for mod_cache, you'll notice mod_cache_socache is mentioned in there and the doc is missing. It might be time to bug the dev list about adding this module again. |
Well it is in the trunk docs
http://httpd.apache.org/docs/trunk/mod/mod_cache_socache.html
--- edit ---
the example
Code: |
# Turn on caching
CacheSocache shmcb
CacheSocacheMaxSize 102400
<Location /foo>
CacheEnable socache
</Location>
# Fall back to the disk cache
CacheSocache shmcb
CacheSocacheMaxSize 102400
<Location /foo>
CacheEnable socache
CacheEnable disk
</Location>
|
|
|
Back to top |
|
glsmith Moderator
Joined: 16 Oct 2007 Posts: 2268 Location: Sun Diego, USA
|
Posted: Tue 04 Sep '12 21:24 Post subject: |
|
|
That's a help, I include the docs page with the module in the above link. The module itself is still not in trunk, unless its hiding somewhere other than trunk/modules/cache |
|
Back to top |
|
maskego
Joined: 16 Apr 2010 Posts: 238
|
|
Back to top |
|
maskego
Joined: 16 Apr 2010 Posts: 238
|
Posted: Wed 05 Sep '12 2:47 Post subject: |
|
|
Thanks for AH to compile mod_cache_socache.
It's a good module for reducing memory consumption and server loading. |
|
Back to top |
|
glsmith Moderator
Joined: 16 Oct 2007 Posts: 2268 Location: Sun Diego, USA
|
Posted: Wed 05 Sep '12 6:36 Post subject: |
|
|
Funny, since it is caching to memory, I would think it would use more memory. It should greatly reduce disk access however, which is much slower. |
|
Back to top |
|
maskego
Joined: 16 Apr 2010 Posts: 238
|
Posted: Wed 05 Sep '12 7:19 Post subject: |
|
|
I know that will consume memory.But,my machine is facing memory leak now since upgrade to apache2.4.3
If this module can reduce this memory leak times,it will be a good module for me as yet. |
|
Back to top |
|
James Blond Moderator
Joined: 19 Jan 2006 Posts: 7371 Location: Germany, Next to Hamburg
|
|
Back to top |
|
maskego
Joined: 16 Apr 2010 Posts: 238
|
|
Back to top |
|
glsmith Moderator
Joined: 16 Oct 2007 Posts: 2268 Location: Sun Diego, USA
|
Posted: Sat 08 Sep '12 0:14 Post subject: |
|
|
I do not see anything either, but most of the directives can be set (or overridden) in the Directory or .htaccess context. One could use some 0s possibly to turn it off. Max cache size of 0 I would expect to not cache for that directory.
It's a first draft module, far from perfected yet possible better than nothing, possibly not. |
|
Back to top |
|
maskego
Joined: 16 Apr 2010 Posts: 238
|
Posted: Sat 08 Sep '12 0:36 Post subject: |
|
|
This module should load mod_cache also.I see a notice note there: Code: | This module should be used with care, as when the CacheQuickHandler directive is in its default value of on, the Allow and Deny directives will be circumvented. You should not enable quick handler caching for any content to which you wish to limit access by client host name, address or environment variable. |
http://httpd.apache.org/docs/2.4/mod/mod_cache.html
Maybe this module can cause some security issues.It should be used with care. |
|
Back to top |
|
glsmith Moderator
Joined: 16 Oct 2007 Posts: 2268 Location: Sun Diego, USA
|
|
Back to top |
|
James Blond Moderator
Joined: 19 Jan 2006 Posts: 7371 Location: Germany, Next to Hamburg
|
Posted: Sat 22 Sep '12 22:52 Post subject: |
|
|
glsmith wrote: |
Yes, the naming extremely confusing! |
You got me! Yes that is troubles!
But than what is mod_socache_memcache realy for? From the mod_socache_memcache docs I'm not smarter.
Quote: |
Summary
mod_socache_memcache is a shared object cache provider which provides for creation and access to a cache backed by the memcached high-performance, distributed memory object caching system.
|
|
|
Back to top |
|
glsmith Moderator
Joined: 16 Oct 2007 Posts: 2268 Location: Sun Diego, USA
|
Posted: Sat 22 Sep '12 23:46 Post subject: |
|
|
James Blond wrote: | But than what is mod_socache_memcache realy for? |
Until now, I don't know. But look at the other socache modules, those are used with mod_ssl for SSLSessionCache.
They wanted cache providers so they could remove all the caching from most likely the core, which is one reason for the smaller footprint. This way, you load what you need.
I'm sure mod_socache_memcache was made with mod_cache_socache in mind to replace mod_mem_cache. It's hard to remember back that far. |
|
Back to top |
|
jimski
Joined: 18 Jan 2014 Posts: 196 Location: USSA
|
Posted: Thu 25 Aug '16 23:08 Post subject: |
|
|
How are the sessions stored and fetched if mod_socache_memcached uses multiple memcache servers.
For example if the config is like this:
SSLSessionCache memcache:10.0.0.5:12345,10.0.0.6:12345,10.0.0.7:12345
1. Will the same SSL session be written to all three memcache servers or just to the first one that is available.
2. If the session is stored only on one of the three servers then how does Apache know to which server should it connect to fetch it. |
|
Back to top |
|