`
kevin_xu
  • 浏览: 36397 次
  • 性别: Icon_minigender_1
  • 来自: 北京
社区版块
存档分类
最新评论
  • 星情泪: 感觉楼主挺强的,那么被拒也许出在了薪资上面吧我也去过那里 感觉 ...
    Exoweb面经

How can I optimize the berkely db je DPL insert(put) performance?

阅读更多
Hi,everone!
I use JE DPL API to insert(put) my entity named AuthService with 5 SecondaryKey,40 fields.
Excute Insert 100000 Records, total times 40172ms, 2456 Records/sec ,quite slow!!!,why??? can i tune it up?
tx commit execute step is 1000 Records。

My OS is:
===========================================================
Win XP2
Interl CPU T2080 1.73GHZ*2
2.0GB Memory Size
160GB Disk Size
-Xmx1024M

My Environment Configs is:
===========================================================
EnvironmentConfig envConfig = new EnvironmentConfig();
envConfig.setAllowCreate(true);
envConfig.setTransactional(true);
envConfig.setCacheSize(300*1024*1024);
envConfig.setTxnNoSync(false);
envConfig.setTxnWriteNoSync(true);
StoreConfig storeConfig = new StoreConfig();
storeConfig.setAllowCreate(true);
storeConfig.setTransactional(true);

EntityStore store = new EntityStore(env, "AuthService", storeConfig);
Transaction tx = store.getEnvironment().beginTransaction(null, null);
AuthServiceAccenssor asAcc = new AuthServiceAccenssor(store);
asAcc.loadAuthServiceDb(store, tx, records, step);

My entity named AuthService is:
===============================================================
@PrimaryKey
public String id;
@SecondaryKey(relate = MANY_TO_ONE)
public String userid;
@SecondaryKey(relate = MANY_TO_ONE)
public String areaid;
@SecondaryKey(relate = MANY_TO_ONE)
public String netid;
@SecondaryKey(relate = MANY_TO_ONE)
public String stockid;
@SecondaryKey(relate = MANY_TO_ONE)
public String productid;
.....................
long i = 0;
AuthService = new AuthService();
while (true) {
String id = String.valueOf(i++);
as.id = id;
as.userid = "userid"+id;
as.areaid = "areaid"+id;
as.netid = "netid"+id;
as.stockid= "stockid"+id;
as.productid = "productid"+id;
as.productname = "Digital TV set-top boxes"+id;
as.isgroup ="1";
as.paymode = "cashe";
as.createdate = new Date();
as.startdate =new Date();
as.enddate = new Date();
as.pausedate = new Date();
as.resumedate = new Date();
as.realstartdate = new Date();
as.realenddate = new Date();
as.formerstatus ="0";
as.status= "1";
as.freestartdate = (new Date());
as.freeenddate = (new Date());
as.refpricefix = 933l;
as.pricefix = 923l;
as.isrenew = "1";
as.auditorid = "auditorid"+i;
as.auditdate = new Date();
as.auditremark = "argee!argee!";
as.ispass ="1";
as.operatorid ="Operatorid"+i;
as.operatedate = new Date();
as.billid = "billid"+i;
as.closedate = new Date();
as.issendcmdahead = "0";
as.remark ="";
as.divideid = "divideid"+i;
as.billTypeId = "billTypeId"+i;
as.billingCyclecount = 14304;
as.orderUserId = "userid"+i;
as.isGenBankPayRecord = "234";
as.isBankPay = "1";
as.billingCount = 123;
as.productInstanceId = "ProductInstanceId"+i;
as.billingCyclePeriodValue = 324;
as.productInstanceName ="Digital TV set-top boxes Purchase";
as.cmngStbTypeName = "persional customer!";

authServiceById.putNoReturn(tx,as);

if ( i% steps == 0){
tx.commit();
tx=null;
tx = store.getEnvironment().beginTransaction(null, null);
}

if ( i % records == 0){
break;
}
}


My Stats is:
===============================================================

Compression stats
splitBins=0
dbClosedBins=0
cursorsBins=0
nonEmptyBins=0
processedBins=0
inCompQueueSize=0

Eviction stats
nEvictPasses=0
nNodesSelected=0
nNodesScanned=0
nNodesExplicitlyEvicted=0
nRootNodesEvicted=0
nBINsStripped=0
requiredEvictBytes=0

Checkpoint stats
nCheckpoints=6
lastCheckpointId=6
nFullINFlush=602
nFullBINFlush=439
nDeltaINFlush=1,578
lastCheckpointStart=0xa/0x20f8ad
lastCheckpointEnd=0xa/0x2a540b
endOfLog=0xa/0x7a4c53

Cleaner stats
cleanerBacklog=0
nCleanerRuns=0
nCleanerDeletions=0
nINsObsolete=0
nINsCleaned=0
nINsDead=0
nINsMigrated=0
nLNsObsolete=0
nLNsCleaned=0
nLNsDead=0
nLNsLocked=0
nLNsMigrated=0
nLNsMarked=0
nLNQueueHits=0
nPendingLNsProcessed=0
nMarkedLNsProcessed=0
nToBeCleanedLNsProcessed=0
nClusterLNsProcessed=0
nPendingLNsLocked=0
nCleanerEntriesRead=0

Cache stats
nNotResident=0
nCacheMiss=0
nLogBuffers=3
bufferBytes=3,145,728
dataBytes=106,651,450
adminBytes=5,559
lockBytes=560
cacheTotalBytes=109,803,297
sharedCacheTotalBytes=0
nSharedCacheEnvironments=0

IO Stats
nRandomReads=0
nRandomWrites=11
nSequentialReads=13
nSequentialWrites=185
nRandomReadBytes=0
nRandomWriteBytes=418
nSequentialReadBytes=26,624
nSequentialWriteBytes=108,012,175

Logging stats
nFSyncs=7
nFSyncRequests=7
nFSyncTimeouts=0
nRepeatFaultReads=0
nTempBufferWrite=0
nRepeatIteratorReads=0
nFileOpens=24
nOpenFiles=0
totalLogSize=108,012,175

records:100000
Excute TestJEDPLAS Read total times 9516ms

分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics