Allocating more than 262965 mutexes?
567221Jun 12 2008 — edited Jun 16 2008Greetings,
I have a process that opens 15 database files totaling about 14 million records, they are opened into an environment with a cache set to hold all the files which is currently about 1.08G. All the databases are opened read-only. Trying to run 30 of these processes causes this error:
unable to allocate memory for mutex; resize mutex region
I scaled the number of processes back to 15 and job completed successfully, and I ran db_stat on the environment mutexs:
$ db_stat -x
20MB 112KB Mutex region size
0 The number of region locks that required waiting (0%)
4 Mutex alignment
1200 Mutex test-and-set spins
263517 Mutex total count
552 Mutex free count
262965 Mutex in-use count
262965 Mutex maximum in-use count
Mutex counts
552 Unallocated
225 db handle
15 env dblist
15 unknown mutex type
1 env region
1 lock region
242 logical lock
1 log filename
1 log flush
16 log region
15 mpoolfile handle
225 mpool filehandle
17 mpool file bucket
15 mpool handle
131071 mpool hash bucket
131071 mpool buffer I/O
1 mpool region
1 unknown mutex type
15 twister
15 txn active list
1 unknown mutex type
1 txn region
A couple of questions come to mind:
1. If the tables are read-only, why are mutexes being used?
2. Why are 262965 mutexes being allocated?
3. To run 30 processes, can I use mutex_set_max() to set the max to 600,000? I did actually try to set 600,000 but the environment stats never showed more than 262965 (looking for a hard coded limit now).
Thanks,
Matthew