Delay on aws (m1.large) with MongoDB 64b 2.x

I deployed the version of 64-bit version 2.x mongodb in the aws m1.large instance.

I'm trying to find the best performance that mongo can give us on aws in light of http://www.snailinaturtleneck.com/blog/tag/mongodb/ (and mongodb read / write performance and mongo hosting in the cloud )

I created one db with one collection, that is, a user, and inserted 100,000 records / json object (each json object size is 4 KB) using a random number as a suffix for "user-". In addition, an index has been created for the user ID.

In addition, I installed db profiler to register a slow request that takes 20 ms or more. I executed a java program with 10 threads. Each java class generates a user ID with a random number and finds it in the user collection in an infinite loop. With such a load, I observed a delay in the request / read of up to 60 ms.

I also noticed that when I start fewer threads, say 3 or 4 (with loading requests to the user collection 5K per second to search for users), I do not see a delay or less than 2 ms latency.

I did not understand why an increase in the load on searching a user in a collection causes latency. I believe that mongo db can do much more parallel reading, and then what I try and should not affect performance as such.

One of the possibilities that I suppose will be that mongo has performance problems if large requests are executed in one collection, as in our case, I expect that from 10 to 20 thousand requests will be requested in one collection per second.

We will be grateful for your thoughts / suggestions.

+4
source share
1 answer

Some information is missing - what is the configuration of your disk? EBS can contribute to latency if everything is saved to disk.

Amazon has released white paper with best practices for installing Mongo on EC2: MongoDB on AWS . Here is his description

This document provides an overview of the general guidelines that apply to all major NoSQL systems, and highlights one of the popular NoSQL systems, MongoDB, and discusses how to best manage it in the AWS cloud. The following are the various MongoDB configurations, so you can optimize them for performance, durability, and security.

0
source

Source: https://habr.com/ru/post/1387847/


All Articles