Announcement Announcement Module
Collapse
No announcement yet.
mongodb on high load (more number of connetions) Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • mongodb on high load (more number of connetions)

    Hi! I'm using spring data to work with mongodb. When number connections increasing, time of query become very long (1 seconds - 13 seconds Oo). When requests go from users - mongodb is very fast (9 ms - 40 ms), but if RabbitMqListener uses mongodb, that time of query become very long. RabbitMqListener work on 10 Concurrent Consumers.

    My beans:

    Code:
        @Bean
        @Scope("singleton")
        public MongoDbFactory mongoDbFactory() throws Exception {
            MongoOptions options = new MongoOptions();
    
    //        options.setConnectionsPerHost(50);
    //        options.setThreadsAllowedToBlockForConnectionMultiplier(10);
    
            UserCredentials userCredentials = new UserCredentials(Const.mongoConfiguration.getUser(), Const.mongoConfiguration.getPwd());
            return new SimpleMongoDbFactory(new Mongo(Const.mongoConfiguration.getHost(), options), Const.mongoConfiguration.getDatabase_name(), userCredentials);
        }
    Code:
        @Bean
        @Scope("singleton")
        public MongoTemplate mongoTemplate() throws Exception {
    
            MongoTemplate mongoTemplate = new MongoTemplate(mongoDbFactory());
            return mongoTemplate;
    
        }
    They should be to make singleton ?

    How can I fix this error?
    Last edited by malahov; Jan 15th, 2013, 03:32 AM.
Working...
X