Shared memory allocation
- Dieses Thema hat 5 Antworten und 1 Teilnehmer, und wurde zuletzt aktualisiert vor 13 Jahre, 10 Monaten von
Anonym.
-
AuthorPosts
-
24. November 2009 um 22:50 Uhr #4063
AnonymInaktivHallo Zusammen,
unter Linux habe ich einen DB2 V9.1 server mit 3-4 aktivierten Datenbanken im Betrieb.
In dessen diag.log sind oft verschiedene Fehlermeldungen zu finden, mir der Bedeutung, dass der Server Mangel an Memory leidet. Z.B. wie folgt:db2 connect to alap09N
SQL1084C Shared memory segments cannot be allocated. SQLSTATE=57019oder:
2009-11-24-15.16.57.229010+060 I1344879E491Â Â Â Â LEVEL: Severe
PIDÂ Â Â : 30652 TIDÂ : 46912637286304PROC : db2agent (ALAP10K)
INSTANCE: db2inst1Â Â Â Â Â Â Â Â NODE : 000
APPHDLÂ : 0-274Â Â Â Â Â Â Â Â Â Â APPID: GA78031A.L005.01BF44141659
AUTHIDÂ : ALAP
FUNCTION: DB2 UDB, base sys utilities, sqleSubsequentConnect, probe:100
RETCODE : ZRC=0x850F0005=-2062614523=SQLO_NOSEG
      "No Storage Available for allocation"
      DIA8305C Memory allocation failure occurred.Deswegen kontrolliere ich seit ein paar Tagen regelmässig mit utility, wieviel memory vom server benutzt sind, in dem die Total Agaben von
db2mtrk –i –d –v –p
gesummt werden. Das Ergebnis ist überraschend:
Durchwegs werden maximal 800-1000 Mb von der insgesamt zur Verfühung stehenden 6 Gb des boxes benutzt.Dementsprechende Zahlen zeigt das Kommando: free –m , wo ständig 4,7-5 Gb cached memory zu sehen sind. Diese sollten eigentlich frei sein, jeder Zeit vom system zurückgegeben werden, sagen die UNIX-Spezialisierte Kollegen.
[db2inst1@hik-db2 db2dump]$ [db2inst1@hik-db2 db2dump]$ free –m
        total  used  free shared  buffers   cached
Mem:Â Â Â Â Â 5913Â Â Â 5870Â Â Â Â 43Â Â Â Â 0Â Â Â Â Â 80Â Â Â Â 5130
-/+ buffers/cache:Â Â Â Â 659Â Â Â Â 5254
Swap:Â Â Â Â Â Â Â Â Â Â Â Â 8189Â Â Â Â Â Â 6Â Â Â Â 8183Die Kernel Parameter Einstellungen scheinen auch in Ordnung zu sein:
ipcs -l
—— Shared Memory Limits ——–
max number of segments = 4096
max seg size (kbytes) = 3565156
max total shared memory (kbytes) = 3565156
min seg size (bytes) = 1—— Semaphore Limits ——–
max number of arrays = 1024
max semaphores per array = 250
max semaphores system wide = 256000
max ops per semop call = 32
semaphore max value = 32767—— Messages: Limits ——–
max queues system wide = 1024
max size of message (bytes) = 65536
default max size of queue (bytes) = 65536Der server und die Datenbanken sind – laut der Konfiguration – auf AUTOMATIC und COMPUTED gestellt. Und wenn so, warum wachsen sie nicht?
Server Infos und Konfigurationen zeige ich am Ende der mail.Also: Warum werden nur 1Gb memory von dem DB2 benutzt? Warum fehlerhaft die memory allocation, wenn andererseits 4-5Gb frei sind?
Kennt jemand eine mögliche Ursache?Danke und Gruß
Katalin
*** db2start mit system infos **********
2009-11-19-14.18.20.492579+060 I1E1301Â Â Â Â Â Â Â Â LEVEL: Event
PIDÂ Â Â : 18497Â Â Â Â Â Â Â Â Â Â TIDÂ : 46912637286304PROC : db2loggr (ALAP09P)
INSTANCE: db2inst1Â Â Â Â Â Â Â Â NODE : 000
FUNCTION: DB2 UDB, RAS/PD component, pdLogInternal, probe:120
STARTÂ Â : New Diagnostic Log file
DATA #1 : Build Level, 152 bytes
Instance "db2inst1" uses "64" bits and DB2 code release "SQL09014"
with level identifier "01050107".
Informational tokens are "DB2 v9.1.0.4", "s080122", "MI00229", Fix Pack "4a".
DATA #2 : System Info, 440 bytes
System: Linux hik-db2.iroda.educatio.hu 6 2 x86_64
CPU: total:2 online:2 Cores per socket:1 Threading degree per core:1
Physical Memory(MB): total:5914 free:154
Virtual Memory(MB): total:14104 free:8338
Swap   Memory(MB): total:8190 free:8184
Kernel  Params: msgMaxMessageSize:65536 msgMsgMap:65536 msgMaxQueueIDs:1024
          msgNumberOfHeaders:65536 msgMaxQueueSize:65536
          msgMaxSegmentSize:16 shmMax:3650719744 shmMin:1 shmIDs:4096
          shmSegments:4096 semMap:256000 semIDs:1024 semNum:256000
          semUndo:256000 semNumPerID:250 semOps:32 semUndoSize:20
          semMaxVal:32767 semAdjustOnExit:32767
Information in this record is only valid at the time when this file was
created (see this record’s time stamp)***** dbm cfg **********
Size of instance shared memory (4KB)Â (INSTANCE_MEMORY) = AUTOMATIC(33792)
   AUTOMATIC(33792)
 Backup buffer default size (4KB)        (BACKBUFSZ) = 2048
   2048
 Restore buffer default size (4KB)       (RESTBUFSZ) = 2048
   2048
 Sort heap threshold (4KB)            (SHEAPTHRES) = 0
   0
 Directory cache support              (DIR_CACHE) = YES
   YES
 Application support layer heap size (4KB)  (ASLHEAPSZ) = 15
   15
 Max requester I/O block size (bytes)      (RQRIOBLK) = 32767
   32767
 Query heap size (4KB)            (QUERY_HEAP_SZ) = 2048
   2048
 Workload impact by throttled utilities(UTIL_IMPACT_LIM) = 10
   10
Max number of existing agents          (MAXAGENTS) = 250
   250
 Agent pool size                (NUM_POOLAGENTS) = 5
   5
 Initial number of agents in pool    (NUM_INITAGENTS) = 0
   0
 Max number of coordinating agents   (MAX_COORDAGENTS) = 250
   (MAXAGENTS – NUM_INITAGENT
 Max no. of concurrent coordinating agents (MAXCAGENTS) = 250
   MAX_COORDAGENTS
 Max number of client connections    (MAX_CONNECTIONS) = 250
   MAX_COORDAGENTS
 Keep fenced process                (KEEPFENCED) = YES
   YES
 Number of pooled fenced processes      (FENCED_POOL) = MAX_COORDAGENTS
   MAX_COORDAGENTS
 Initial number of fenced processes   (NUM_INITFENCED) = 0
   0
 Index re-creation time and redo index build (INDEXREC) = RESTART
   RESTART**** db cfg for ALAP10K **********
Self tuning memory             (SELF_TUNING_MEM) = ON (Active)
   ON
 Size of database shared memory (4KB) (DATABASE_MEMORY) = COMPUTED(222784)
   COMPUTED(222704)
 Database memory threshold          (DB_MEM_THRESH) = 10
   10
 Max storage for lock list (4KB)         (LOCKLIST) = AUTOMATIC(2144)
   AUTOMATIC(2144)
 Percent. of lock lists per application    (MAXLOCKS) = AUTOMATIC(98)
   AUTOMATIC(98)
 Package cache size (4KB)            (PCKCACHESZ) = AUTOMATIC(58928)
   AUTOMATIC(58928)
 Sort heap thres for shared sorts (4KB) (SHEAPTHRES_SHR) = AUTOMATIC(11286)
   AUTOMATIC(11286)
 Sort list heap (4KB)                (SORTHEAP) = AUTOMATIC(1129)
   AUTOMATIC(1129)
 Database heap (4KB)                  (DBHEAP) = 32768
   32768
 Catalog cache size (4KB)         (CATALOGCACHE_SZ) = 4096
   4096
 Log buffer size (4KB)                (LOGBUFSZ) = 512
   512
 Utilities heap size (4KB)          (UTIL_HEAP_SZ) = 8192
   8192
 Buffer pool size (pages)              (BUFFPAGE) = 1000
   1000
 Max size of appl. group mem set (4KB) (APPGROUP_MEM_SZ) = 8192
   8192
 Percent of mem for appl. group heap  (GROUPHEAP_RATIO) = 70
   70
 Max appl. control heap size (4KB)   (APP_CTL_HEAP_SZ) = 8192
   8192
 SQL statement heap (4KB)              (STMTHEAP) = 4096
   4096
 Default application heap (4KB)        (APPLHEAPSZ) = 2048
   2048
 Statistics heap size (4KB)          (STAT_HEAP_SZ) = 8192
   8192
 Interval for checking deadlock (ms)      (DLCHKTIME) = 10000
   10000
 Lock timeout (sec)                (LOCKTIMEOUT) = 240
   240
Number of asynchronous page cleaners  (NUM_IOCLEANERS) = AUTOMATIC(1)
   AUTOMATIC(1)
 Number of I/O servers            (NUM_IOSERVERS) = AUTOMATIC(6)
   AUTOMATIC(6)
 Index sort flag                   (INDEXSORT) = YES
   YES
 Sequential detect flag              (SEQDETECT) = YES
   YES
 Default prefetch size (pages)      (DFT_PREFETCH_SZ) = AUTOMATIC
   AUTOMATIC Track modified pages                (TRACKMOD) = NO
   NO
 Default number of containers                  = 1
   1
 Default tablespace extentsize (pages)  (DFT_EXTENT_SZ) = 32
   32
 Max number of active applications        (MAXAPPLS) = AUTOMATIC(200)
   AUTOMATIC(200)
 Average number of active applications    (AVG_APPLS) = 50
   50
Max DB files open per application        (MAXFILOP) = 64
   64
 Log file size (4KB)                (LOGFILSIZ) = 8192
   8192
 Number of primary log files          (LOGPRIMARY) = 32
   32
 Number of secondary log files          (LOGSECOND) = 16
   16
 Block log on disk full          (BLK_LOG_DSK_FUL) = NO
   NO
 Percent max primary log space by transaction (MAX_LOG) = 0
 Num. of active log files for 1 active UOW(NUM_LOG_SPAN) = 0
   0
 Group commit count                 (MINCOMMIT) = 3
   3
 Percent log file reclaimed before soft chckpt (SOFTMAX) = 520
   520
 Log retain for recovery enabled        (LOGRETAIN) = RECOVERY
   RECOVERY
 User exit for logging enabled          (USEREXIT) = OFF
   OFF
   120
 First log archive method           (LOGARCHMETH1) = LOGRETAIN
   LOGRETAIN
Auto restart enabled              (AUTORESTART) = ON
   ON
 Index re-creation time and redo index build (INDEXREC) = SYSTEM (RESTART)
   SYSTEM (RESTART)
 Log pages during index build        (LOGINDEXBUILD) = OFF
   OFF
 Default number of loadrec sessions  (DFT_LOADREC_SES) = 1
   1
26. November 2009 um 15:40 Uhr #4225
AnonymInaktivHallo VKati,
vorneweg erstmal die Frage: Wie sehen die Limits des verwendeten Instance Users db2inst1 ([tt]ulimit -a[/tt]) aus?
Dann: Kennst Du schon die IBM Meldung LI73956: LINUX ASLR (ADDRESS SPACE LAYOUT RANDOMIZATION) MAY CAUSE DB2 PROCESSES TO BE UNABLE TO ATTACH TO SHARED MEMORY
(siehe anhängende PDF File).Die IBM-Meldung empfiehlt:
The Linux ASLR can be disabled by setting the following kernel parameter:
[tt]kernel.randomize_va_space=0[/tt]
Or temporarily disabled by updating the following in /proc:
[tt]/proc/sys/kernel/randomize_va_space=0[/tt]Viele Grüße
Gernot30. November 2009 um 15:58 Uhr #4345
AnonymInaktivHallo Gernot,
ooooops, das ist genau unser Fall! – dachte ich, nachdem ich dieses IBM Document gelesen hatte. Ich habe den Kernel Parameter (vorübergehend) umgestellt und aktivierte die Datenbanken, also versuchte… Doch keine mehr memory allocation als früher, leider! Inzwischen habe ich die Datenbanken separiert, n dem sie unter verschiedenen Instancen umgelegen worden. Das hat auch nicht geholfen.
Aber eines ist sicher: dieses Linux, worum es hier geht, ist keines von den vom IBM offiziell unterstützten Arten, sondern Centos. Daher muss dieses box dringend neuinstalliert werden, und deswegen verspätete meine Antwort einige Tage: ich war sehr beschäftigt damit, dass die Datenbanken rasch umgezogen werden und die Anwender sie wieder benutzen können.
Danke für die Infos Gernot!
MfG
Katalin
30. November 2009 um 19:57 Uhr #4429
AnonymInaktivHi Katalin,
vielen Dank, dass Du uns über Deine Fortschritte auf dem Laufenden hältst.
Ich bin gespannt wie es weiter geht. ::)
Aber nun doch nochmal die wichtige Frage: [tt]ulimit -a[/tt] ???
Gruß
Gernot
1. Dezember 2009 um 23:09 Uhr #4483
AnonymInaktivHi Gernot,
es ging so weiter, dass ich jetzt 4 Servers habe, jede hat nur 1 Datenbank. Man kann damit gut spielen :-(, jegliche 2 von den 4 aktiviert werden können, aber eine dritte nicht mehr…
Inzwischen haben wir mit einem winzigen java Programm kontrolliert, dass die freien cached 5Gb vom Linux herausgegeben und besetzt werden können. Nur DB2 leidet an Mangel…
Schau mal die ulimit Einstellungen (für jeden DB2 Server das gleiche). Was meinst Du darüber??
Gruß
Katalin
[db2inst1@hik-db2 ~]$ ulimit -a
core file size      (blocks, -c) 0
data seg size       (kbytes, -d) unlimited
max nice                (-e) 0
file size          (blocks, -f) unlimited
pending signals           (-i) 49152
max locked memory    (kbytes, -l) 32
max memory size      (kbytes, -m) unlimited
open files              (-n) 1024
pipe size        (512 bytes, -p) 8
POSIX message queues   (bytes, -q) 819200
max rt priority           (-r) 0
stack size         (kbytes, -s) 10240
cpu time          (seconds, -t) unlimited
max user processes         (-u) 49152
virtual memory      (kbytes, -v) unlimited
file locks              (-x) unlimited
[db2inst1@hik-db2 ~]$
3. Dezember 2009 um 17:25 Uhr #4511
AnonymInaktivHallo Katalin,
ich habe leider erst kürzlich bemerkt, dass Ihr mit [tt]SELF_TUNING_MEM = ON[/tt] arbeitet. Dann war mir aufgefallen, dass wir beiden Anfang März hierm im Forum bereits ein Problem auf Sun/Solaris besprochen hatten, das auch STMM zusammenhing. Siehe Thread https://www.ruban.de/cgi-bin/yabb2/YaBB.pl?action=print;num=1234890080!
Damals wie heute empfehle ich bei solchen Problemen: [tt]SELF_TUNING_MEM = OFF, INTRA_PARALLEL = NO, AUTO_REORG = OFF[/tt], so wenig wie möglich Automatik.
Übrigens könnte Dir [tt]db2pd -memsets -alldbs[/tt] und [tt]db2pd -osinfo[/tt] weiterhelfen.
Viel Erfolg
Gernot
-
AuthorPosts
You must be logged in to reply to this topic.