Jesus, my problem was resolved after I set "mutex_set_max" to 30000 in DB_CONFIG. I use 256 db files to store my data. Maybe we need add env->mutex_set_max support pybsddb .