fuyou
2014-05-08 12:01:25 UTC
hi all
My program insert some data to MySQL Server,becasue some reason ,can't
batch insert.
In my benchmarks,the bottleneck is jdbc,how to improve performance?
see the jstack
"recvMsgWorkTPConfig-11-thread-20" prio=10 tid=0x00002aaac0445000
nid=0x399b runnable [0x000000004af94000]
java.lang.Thread.State: RUNNABLE
at java.util.zip.CRC32.updateBytes(Native Method)
at java.util.zip.CRC32.update(CRC32.java:74)
//omission ...
"recvMsgWorkTPConfig-11-thread-6" prio=10 tid=0x000000000bcc4000 nid=0x3987
runnable [0x0000000049b7f000]
java.lang.Thread.State: RUNNABLE
at java.net.SocketInputStream.socketRead0(Native Method)
at java.net.SocketInputStream.read(SocketInputStream.java:152)
at java.net.SocketInputStream.read(SocketInputStream.java:122)
show create talbe :
CREATE TABLE `test` (
`MESSAGE_ID` varchar(32) NOT NULL,
`COMMITTED` varchar(1) NOT NULL,
`GMT_CREATE` datetime NOT NULL,
`GMT_LAST_DELIVERY` datetime NOT NULL,
`DELIVERY_COUNT` smallint(6) NOT NULL,
`FLAG` int(11) NOT NULL,
`TIME_TO_LIVE` int(11) NOT NULL,
`DLQ_TIME` int(11) NOT NULL,
`POST_TIME_OUT` int(11) NOT NULL,
`BORN_TIME` bigint(20) NOT NULL,
`GROUP_ID` varchar(64) NOT NULL,
`TOPIC` varchar(32) NOT NULL,
`MESSAGE_TYPE` varchar(64) NOT NULL,
`HOST_NAME` varchar(32) NOT NULL,
`SERVER_TAG` varchar(32) NOT NULL,
`NEXT_DELIVER_TIME` bigint(20) DEFAULT NULL,
`FAILED_TARGET` text,
`SYSTEM_DEFINED_PROPERTIES` varchar(4000) DEFAULT NULL,
`USER_DEFINED_PROPERTIES` varchar(4000) DEFAULT NULL,
`CONTEXT_DATA` varchar(4000) DEFAULT NULL,
`BYTES_BODY` blob NOT NULL,
`ID` bigint(64) unsigned NOT NULL AUTO_INCREMENT,
PRIMARY KEY (`ID`),
KEY `SERVER_TOPIC_MESSAGE_TYPE_NEXT_DELIVER`
(`SERVER_TAG`,`NEXT_DELIVER_TIME`,`TOPIC`,`MESSAGE_TYPE`),
KEY `idx_create` (`GMT_CREATE`),
KEY `IDX_MESSAGE_ID` (`MESSAGE_ID`)
) ENGINE=InnoDB AUTO_INCREMENT=2806173 DEFAULT CHARSET=utf8;
My program insert some data to MySQL Server,becasue some reason ,can't
batch insert.
In my benchmarks,the bottleneck is jdbc,how to improve performance?
see the jstack
"recvMsgWorkTPConfig-11-thread-20" prio=10 tid=0x00002aaac0445000
nid=0x399b runnable [0x000000004af94000]
java.lang.Thread.State: RUNNABLE
at java.util.zip.CRC32.updateBytes(Native Method)
at java.util.zip.CRC32.update(CRC32.java:74)
//omission ...
"recvMsgWorkTPConfig-11-thread-6" prio=10 tid=0x000000000bcc4000 nid=0x3987
runnable [0x0000000049b7f000]
java.lang.Thread.State: RUNNABLE
at java.net.SocketInputStream.socketRead0(Native Method)
at java.net.SocketInputStream.read(SocketInputStream.java:152)
at java.net.SocketInputStream.read(SocketInputStream.java:122)
show create talbe :
CREATE TABLE `test` (
`MESSAGE_ID` varchar(32) NOT NULL,
`COMMITTED` varchar(1) NOT NULL,
`GMT_CREATE` datetime NOT NULL,
`GMT_LAST_DELIVERY` datetime NOT NULL,
`DELIVERY_COUNT` smallint(6) NOT NULL,
`FLAG` int(11) NOT NULL,
`TIME_TO_LIVE` int(11) NOT NULL,
`DLQ_TIME` int(11) NOT NULL,
`POST_TIME_OUT` int(11) NOT NULL,
`BORN_TIME` bigint(20) NOT NULL,
`GROUP_ID` varchar(64) NOT NULL,
`TOPIC` varchar(32) NOT NULL,
`MESSAGE_TYPE` varchar(64) NOT NULL,
`HOST_NAME` varchar(32) NOT NULL,
`SERVER_TAG` varchar(32) NOT NULL,
`NEXT_DELIVER_TIME` bigint(20) DEFAULT NULL,
`FAILED_TARGET` text,
`SYSTEM_DEFINED_PROPERTIES` varchar(4000) DEFAULT NULL,
`USER_DEFINED_PROPERTIES` varchar(4000) DEFAULT NULL,
`CONTEXT_DATA` varchar(4000) DEFAULT NULL,
`BYTES_BODY` blob NOT NULL,
`ID` bigint(64) unsigned NOT NULL AUTO_INCREMENT,
PRIMARY KEY (`ID`),
KEY `SERVER_TOPIC_MESSAGE_TYPE_NEXT_DELIVER`
(`SERVER_TAG`,`NEXT_DELIVER_TIME`,`TOPIC`,`MESSAGE_TYPE`),
KEY `idx_create` (`GMT_CREATE`),
KEY `IDX_MESSAGE_ID` (`MESSAGE_ID`)
) ENGINE=InnoDB AUTO_INCREMENT=2806173 DEFAULT CHARSET=utf8;
--
=============================================
fuyou001
Best Regards
=============================================
fuyou001
Best Regards