Re: OPenLDAP instances frequently crashes

2018-06-13 Thread Quanah Gibson-Mount
--On Thursday, June 14, 2018 12:12 AM +0200 Saurabh Lahoti 
 wrote:

 

To conclude on this discussion, does OS flavor affects the slapd
operations & management.


Different OSes have different strategies on what to do when they run out of 
memory, sure.



Kindly suggest your advice..


I already provided the advice necessary for what to do in the previous 
email.


--Quanah

--

Quanah Gibson-Mount
Product Architect
Symas Corporation
Packaged, certified, and supported LDAP solutions powered by OpenLDAP:





Re: OPenLDAP instances frequently crashes

2018-06-13 Thread Quanah Gibson-Mount
--On Wednesday, June 13, 2018 11:30 PM +0200 Saurabh Lahoti 
 wrote:



Jun 11 23:01:37 musang kernel: Out of memory: Kill process 22184 (slapd)
score 888 or sacrifice child
Jun 11 23:01:37 musang kernel: Killed process 22184, UID 0, (slapd)
total-vm:52226320kB, anon-rss:37170216kB, file-rss:1044kB


This is not slapd crashing.  This is linux OOM deciding to kill slapd for 
you because your system ran out of memory, and slapd was the last thing to 
ask for more memory.  The total memory requirements for slapd are not 
limited to just what's stored in the database.  And, given that you're 
using back-bdb or back-hdb, the memory requirements are significantly 
higher than the size of the DB, as slapd has to have multiple caches (at 
least 3) to help overcome performance issues in BDB (dncache, idlcache, 
entrycache).


Add more memory.  Better, yet, ensure you are running the latest version of 
OpenLDAP and switch to back-mdb, which has significantly smaller memory 
requirements than back-bdb/hdb.


--Quanah

--

Quanah Gibson-Mount
Product Architect
Symas Corporation
Packaged, certified, and supported LDAP solutions powered by OpenLDAP:





Re: Logging Region out of memory

2018-06-13 Thread Howard Chu

Scott Mayo wrote:
Actually, I am moving to Windows 2016. :(  Not because of me, but I plan on 
retiring in a few years and when I do, whoever comes after me will more than 
likely be a Windows guy and not Linux.  I am trying to get everything ready 
for the next person when I leave.  We live in a small Rural Community and 
there are virtually no techs around here that deal with Linux anymore.


Bad news for whoever takes over after you. Windows requires a lot more 
vigilance than Linux.


https://www.theregister.co.uk/2018/06/12/patch_tuesday_microsoft_june_2018/

Also, as an aside - OpenLDAP on Windows is still superior to Microsoft AD...

--
  -- Howard Chu
  CTO, Symas Corp.   http://www.symas.com
  Director, Highland Sun http://highlandsun.com/hyc/
  Chief Architect, OpenLDAP  http://www.openldap.org/project/



Re: OPenLDAP instances frequently crashes

2018-06-13 Thread Quanah Gibson-Mount
--On Wednesday, June 13, 2018 8:56 AM +0200 Michael Ströder 
 wrote:



On 06/12/2018 06:15 AM, Saurabh Lahoti wrote:

Frequently, our OpenLDAP instances crashes thereby leading us into severe
disastrous results & outages for business.

While going through slapd logs, it always says " bdb_db_open: database:
unclean shutdown detected; attempting recovery"

What could possibly go wrong here..?


Which OpenLDAP version are you using? Which OS?


What does openldap log before it crashes?

--Quanah


--

Quanah Gibson-Mount
Product Architect
Symas Corporation
Packaged, certified, and supported LDAP solutions powered by OpenLDAP:





Re: Logging Region out of memory

2018-06-13 Thread Howard Chu

Michael Ströder wrote:

On 06/12/2018 06:56 PM, Scott Mayo wrote:

Openldap version is 2.4.12


Seriously? This is really ancient release almost 10 years old.
Being in your position my next task would be to update such an old
system (not only because of OpenLDAP).


Logging region out of memory; you may need to increase its size
db_open(/var/lib/ldap/id2entry.bdb) failed: Cannot allocate memory (12).


What does your monitoring say about memory usage before that log message?


System-wide memory usage is irrelevant, this is a BDB error message.

See 
https://docs.oracle.com/database/bdb181/html/api_reference/C/envset_lg_bsize.html


And switch to back-mdb after you upgrade to a current OpenLDAP release.

--
  -- Howard Chu
  CTO, Symas Corp.   http://www.symas.com
  Director, Highland Sun http://highlandsun.com/hyc/
  Chief Architect, OpenLDAP  http://www.openldap.org/project/



Re: Logging Region out of memory

2018-06-13 Thread Dieter Klünter
Am Tue, 12 Jun 2018 11:56:23 -0500
schrieb Scott Mayo :

> I just started getting this early this morning.  I set this server up
> a number of years ago.  I am getting ready to put a new one in place,
> but need to get this back up and going in the mean time.
> 
> Openldap version is 2.4.12
> 
> /sbin/service ldap start
> 
> Checking configuration files for slapd:[FAILED]
> Logging region out of memory; you may need to increase its size
> db_open(/var/lib/ldap/id2entry.bdb) failed: Cannot allocate memory
> (12). backend_startup_one: bi_db_open failed! (12)
> slap_startup failed (test would succeed using the -u switch)
> stale lock files may be present in /var/lib/ldap   [WARNING]
> 
> Any ideas on what I need to check there?  Thanks.

The reference to -u switch leads to the impression that filesystem
owwnership of slapd.conf and bdb database files is not appropriate.
In addition you may check the database with BerkeleyDB tools, i.e.
db_stat.

-Dieter

-- 
Dieter Klünter | Systemberatung
http://sys4.de
GPG Key ID: E9ED159B
53°37'09,95"N
10°08'02,42"E