activemq-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From James Black <be_st...@yahoo.co.uk>
Subject Re: ActiveMQ JDBC Storage Slow down
Date Wed, 03 Aug 2011 15:53:46 GMT
Hi Gary,

thanks again.

Yes some of the queues grow larger than previously in terms of pending
messages just before the tmp store is created.

So we need to increase our memoryUsage under the systemUsage element of the
broker configuration?  Currently it will just be using the defaults.

I was not aware that the messages were stored in memory as well as being
persisted in the database.  How does this improve performance because surely
for persistence the database must be written to as well?

The xml config is below:



<beans
  xmlns="http://www.springframework.org/schema/beans"
  xmlns:amq="http://activemq.apache.org/schema/core"
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  xsi:schemaLocation="http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans-2.0.xsd
  http://activemq.apache.org/schema/core
http://activemq.apache.org/schema/core/activemq-core.xsd">

    
    <bean
class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer">
        <property name="locations">
            <value>file:${activemq.base}/conf/credentials.properties</value>
        </property>      
    </bean>

    
    <broker xmlns="http://activemq.apache.org/schema/core" 
            brokerName="master-01" 
            dataDirectory="${activemq.base}/data" 
			
            destroyApplicationContextOnStop="true">
 
        
              
        <destinationPolicy>
            <policyMap>
              <policyEntries>
                <policyEntry topic=">" producerFlowControl="true"
memoryLimit="1mb">
                  <pendingSubscriberPolicy>
                    <vmCursor />
                  </pendingSubscriberPolicy>
                </policyEntry>
                <policyEntry queue=">" producerFlowControl="true"
memoryLimit="1mb">
                  
                </policyEntry>
              </policyEntries>
            </policyMap>
        </destinationPolicy> 
 
        
        
        <managementContext>
            <managementContext createConnector="false"/>
        </managementContext>

        
        <persistenceAdapter>
            <jdbcPersistenceAdapter createTablesOnStartup="false" 
dataDirectory="${activemq.base}/data" dataSource="#sqlserver-ds">
            <statements>
                <statements>
                    <property
xmlns="http://www.springframework.org/schema/beans"
name="createSchemaStatements">
                        <list>
                            <value>CREATE TABLE ACTIVEMQ_MSGS(ID BIGINT NOT
NULL, CONTAINER VARCHAR(250), MSGID_PROD VARCHAR(250), MSGID_SEQ BIGINT,
EXPIRATION BIGINT, MSG IMAGE, CONSTRAINT PK_MSGS PRIMARY KEY ( ID )
)</value>
                            <value>CREATE INDEX ACTIVEMQ_MSGS_MIDX ON
ACTIVEMQ_MSGS (MSGID_PROD,MSGID_SEQ)</value>
                            <value>CREATE INDEX ACTIVEMQ_MSGS_CIDX ON
ACTIVEMQ_MSGS (CONTAINER)</value>
                            <value>CREATE INDEX ACTIVEMQ_MSGS_EIDX ON
ACTIVEMQ_MSGS (EXPIRATION)</value>
                            <value>CREATE TABLE ACTIVEMQ_ACKS(CONTAINER
VARCHAR(250) NOT NULL, SUB_DEST VARCHAR(250), CLIENT_ID VARCHAR(250) NOT
NULL, SUB_NAME VARCHAR(250) NOT NULL, SELECTOR VARCHAR(250), LAST_ACKED_ID
BIGINT, PRIORITY BIGINT DEFAULT 5 NOT NULL, CONSTRAINT PK_ACKS PRIMARY KEY (
CONTAINER, CLIENT_ID, SUB_NAME, PRIORITY))</value>
                            <value>CREATE TABLE ACTIVEMQ_LOCK( ID BIGINT NOT
NULL, TIME BIGINT, BROKER_NAME VARCHAR(250), PRIMARY KEY (ID) )</value>
                            <value>INSERT INTO ACTIVEMQ_LOCK(ID) VALUES
(1)</value>
                            <value>ALTER TABLE ACTIVEMQ_MSGS ADD PRIORITY
BIGINT</value>
                            <value>CREATE INDEX ACTIVEMQ_MSGS_PIDX ON
ACTIVEMQ_MSGS (PRIORITY)</value>
                         </list>
                     </property>
                </statements>
            </statements>
            </jdbcPersistenceAdapter>
        </persistenceAdapter>
        
        
          
		  
        
        <transportConnectors>
            <transportConnector name="openwire" uri="tcp://0.0.0.0:61616"/>
        </transportConnectors>

    </broker>
    
    
    <bean id="sqlserver-ds" class="org.apache.commons.dbcp.BasicDataSource"
destroy-method="close">
        <property name="driverClassName"
value="com.microsoft.sqlserver.jdbc.SQLServerDriver"/>
        <property name="url"
value="jdbc:sqlserver://localhost:1443;database=activemq"/>
        <property name="username" value="usera"/>
        <property name="password" value="blah"/>
        <property name="maxActive" value="200"/>
        <property name="poolPreparedStatements" value="true"/>
    </bean>

    
    <import resource="jetty.xml"/>
    
</beans>



--
View this message in context: http://activemq.2283324.n4.nabble.com/ActiveMQ-JDBC-Storage-Slow-down-tp3712166p3715975.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.

Mime
View raw message