1

For the context : Apache HTTPD 2.4.6-90.el7 on RHEL 7.4

  • I had a AH01873: Init: Session Cache is not configured [hint: SSLSessionCache] warning in the logs, so I added to the configuration :
<IfModule socache_shmcb_module>
    SSLSessionCache shmcb:/run/httpd/sslcache(512000)
</IfModule>
  • I checked the socache_shmcb_module module is loaded :
$ httpd -M | grep shmcb
socache_shmcb_module (shared)
  • I checked the syntax was fine :
$httpd -t
Syntax OK
  • then did a graceful restart :
httpd -k graceful
  • afterwards, I saw no more AH01873: Init: Session Cache is not configured [hint: SSLSessionCache] warning in the logs. Hours later, the whole HTTPD server was not functional anymore and the logs reported :
[socache_shmcb:error] AH00820: shared memory segment too small

The Apache documentation itself gives no details about the size of this cache, the value I applied is actually the one shown in examples.

How may I determine the acceptable size of this cache ? Do you have any details regarding this AH00820 error ?

Httqm
  • 297

2 Answers2

0

The output of mod_status includes a section on session cache status and usage. Here's what it looks like on our host:

SSL/TLS Session Cache Status:
cache type: SHMCB, shared memory: 512000 bytes, current entries: 0
subcaches: 32, indexes per subcache: 88
index usage: 0%, cache usage: 0%
total entries stored since starting: 0
total entries replaced since starting: 0
total entries expired since starting: 0
total (pre-expiry) entries scrolled out of the cache: 0
total retrieves since starting: 0 hit, 8 miss
total removes since starting: 0 hit, 0 miss

You could monitor that, and/or double the cache size until the problems go away.

0

Answering my own question : my mistake was I added to the Apache configuration :

<IfModule socache_shmcb_module>
    SSLSessionCache shmcb:/run/httpd/sslcache(512000)
</IfModule>

The crash and AH00820 error did not occur again after I changed that to :

<IfModule socache_shmcb_module>
    SSLSessionCache shmcb:/run/httpd/sslcache(512000)
    SSLSessionCacheTimeout 300
</IfModule>

The Apache documentation mentions that SSLSessionCacheTimeout 300 is the default value, which is why I initially omitted it. Looks like this directive is mandatory, even to repeat the default value.

Back to my initial questions :

1. How may I determine the acceptable size of this cache ?

Once Apache is configured with both SSLSessionCache and SSLSessionCacheTimeout directives, it is stable again and mod_status (described in the answer + comments above) outputs the percentage of cache used. It's pretty low in my case, so the configured value 512000 looks fine.

2. Do you have any details regarding this AH00820 error ?

Not much about this error, actually. I just can tell it disappeared when I used both directives.

Httqm
  • 297