[pybsddb] IO wait up to 100% after put 2 million keys

李明修 xjtukanif at gmail.com
Thu Jun 4 11:01:04 CEST 2009


Hi, guys:

         I used pybsddb to operate bdb, but everytime after I put 2 million
keys , IO wail would up to 100%, but it's ok when I use C API to operate
BDB.
         Any help would be appreciate.

       dbenv.set_cachesize(0, cachesize64*1024*104, 0)  #  I had
tried  256K, 1M, 2M , 16M, 64M
       dbenv.open(dir, DB_PRIVATE | DB_CREATE | DB_INIT_LOCK | DB_INIT_MPOOL
| DB_THREAD | DB_INIT_LOG)
       bdb = DB(dbenv)
       bdb.set_pagesize(4096)  # some to os block
       for i in xrange(3500000):
            tmp['%s_/root/2000/dsaf/aaa/aa' % i] = (1, 1)
       for k, v in tmp.iteritems():
            db.put(k, phpserialize.dumps(v))   # phpserialize.dumps just
change (1, 1) to a serialize string
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mailman.jcea.es/pipermail/pybsddb/attachments/20090604/07e60ddf/attachment.htm>


More information about the pybsddb mailing list