logo
Apache Lounge
Webmasters

 

About Forum Index Downloads Search Register Log in RSS X


Keep Server Online

If you find the Apache Lounge, the downloads and overall help useful, please express your satisfaction with a donation.

or

Bitcoin

A donation makes a contribution towards the costs, the time and effort that's going in this site and building.

Thank You! Steffen

Your donations will help to keep this site alive and well, and continuing building binaries. Apache Lounge is not sponsored.
Post new topic   Forum Index -> Apache View previous topic :: View next topic
Reply to topic   Topic: mod_mem_cache, mod_socache_memcache and 2.4
Author
glsmith
Moderator


Joined: 16 Oct 2007
Posts: 2268
Location: Sun Diego, USA

PostPosted: Mon 03 Sep '12 22:10    Post subject: mod_mem_cache, mod_socache_memcache and 2.4 Reply with quote

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: 7298
Location: Germany, Next to Hamburg

PostPosted: Tue 04 Sep '12 16:56    Post subject: Reply with quote

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

PostPosted: Tue 04 Sep '12 21:24    Post subject: Reply with quote

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

PostPosted: Wed 05 Sep '12 2:23    Post subject: Reply with quote

If install those module,should it need to install mod_cache too?

There is an note there:
Code:

mod_cache_socache requires the services of mod_cache, which must be loaded before mod_cache_socache.

http://httpd.apache.org/docs/trunk/mod/mod_cache_socache.html
Back to top
maskego



Joined: 16 Apr 2010
Posts: 238

PostPosted: Wed 05 Sep '12 2:47    Post subject: Reply with quote

Thanks for AH to compile mod_cache_socache. Very Happy
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

PostPosted: Wed 05 Sep '12 6:36    Post subject: Reply with quote

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

PostPosted: Wed 05 Sep '12 7:19    Post subject: Reply with quote

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: 7298
Location: Germany, Next to Hamburg

PostPosted: Wed 05 Sep '12 12:07    Post subject: Reply with quote

glsmith wrote:
The module itself is still not in trunk, unless its hiding somewhere other than trunk/modules/cache


Isn't it http://svn.apache.org/repos/asf/httpd/httpd/trunk/modules/cache/mod_socache_memcache.c and http://svn.apache.org/repos/asf/httpd/httpd/trunk/modules/cache/mod_socache_memcache.dsp ?
Back to top
maskego



Joined: 16 Apr 2010
Posts: 238

PostPosted: Fri 07 Sep '12 23:56    Post subject: Reply with quote

Is there directive to exclude some path from mod_cache_socache?It makes poll get failed.
I can't find at http://httpd.apache.org/docs/trunk/mod/mod_cache_socache.html
Back to top
glsmith
Moderator


Joined: 16 Oct 2007
Posts: 2268
Location: Sun Diego, USA

PostPosted: Sat 08 Sep '12 0:14    Post subject: Reply with quote

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

PostPosted: Sat 08 Sep '12 0:36    Post subject: Reply with quote

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

PostPosted: Sat 22 Sep '12 3:19    Post subject: Reply with quote

James Blond wrote:
Isn't it http://svn.apache.org/repos/asf/httpd/httpd/trunk/modules/cache/mod_socache_memcache.c and http://svn.apache.org/repos/asf/httpd/httpd/trunk/modules/cache/mod_socache_memcache.dsp ?


Late response, no, mod_socache_memcache is not a 2.4 replacement for mod_mem_cache in 2.2, mod_cache_socache is.

Yes, the naming is extremely confusing!

Good news however, this module is one step closer to getting into 2.4 today with it's addition in trunk.
http://svn.apache.org/viewvc?view=revision&revision=1388660
http://svn.apache.org/viewvc?view=revision&revision=1388899


Last edited by glsmith on Sat 22 Sep '12 23:47; edited 2 times in total
Back to top
James Blond
Moderator


Joined: 19 Jan 2006
Posts: 7298
Location: Germany, Next to Hamburg

PostPosted: Sat 22 Sep '12 22:52    Post subject: Reply with quote

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. Shocked
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

PostPosted: Sat 22 Sep '12 23:46    Post subject: Reply with quote

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

PostPosted: Thu 25 Aug '16 23:08    Post subject: Reply with quote

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


Reply to topic   Topic: mod_mem_cache, mod_socache_memcache and 2.4 View previous topic :: View next topic
Post new topic   Forum Index -> Apache