Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6211125
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T06:16:58+00:00 2026-05-24T06:16:58+00:00

I’m running write intensive MongoDB for a web app and I’m getting extraordinarily poor

  • 0

I’m running write intensive MongoDB for a web app and I’m getting extraordinarily poor performance from it. This being said, I’m fairly certain that the problem has more to do with up our code, setup and/or our usage than in mongo itself.

I’m about to crack my head open with a sledgehammer out of despair so I was wondering if anybody would mind looking at some of the outputs I’ve prepared to see if anything seems problematic.

  • db.stats()
  • fstab, mdadm and iostat -xm 2
  • mongostat

The code is not too complicated (it’s in PHP, btw). It’s pretty much a lot of ->find() and ->update(). I made sure to use indexes for both calls and confirmed they were indeed being used by doing explain() on the queries.

I’ve tried 1 server (ec2 m2.2xlarge), 4 servers (2 shards of 2 reps) and 9 servers (3 shards of 3 reps) and wasn’t able to get much out of those.

On good moments, I can’t get anything more than 1500 writes per second (insert + update). Most of the time, I’m lucky to reach a combined amount of 100 insert/update and I always have a big “locked %” and a lot of queries queued “qr|qw”.

Right now, I have a script that’s running and it’s crawling. The worst thing is, when I look at mongostat for a while, the amount of RAM used in “res” is about 50% of the server’s available RAM and there’s more than enough RAM to fit the indexes of all collections. There’s no reason why this isn’t spitting out data like crazy.

I must have recoded the app 2-3 times already, trying to find better access patterns for the data. I’ve read everything I could read on indexes, updating, shard keys and what not. All the servers I put mongo on are using a 8 EBS disks raid 10 setup with some performance tweaks added (blockdev, noatime, etc…).

I know the problem is on my end and I’m not blaming mongodb. I know bigger companies than me are using it for write intensive applications and that they absolutely love it (foursquare for example). At the same time, I just can’t understand what I’m doing wrong and why I’m getting such poor performance, no matter what I do.

Additional Info:

  • All servers (client and server) are running Ubuntu 10.04 LTS with MongoDB 1.8.2
  • All servers are on EC2 East and in the same zone
  • Currently, I’m back at 1 m2.2xlarge server (4 cores, 34.2 GB RAM) until I can figure out where the problem is.
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-24T06:16:59+00:00Added an answer on May 24, 2026 at 6:16 am

    So the first problem is that your disk seems to be primarily occupied with reading instead of writing. (based on iostat). Your utilization is well over 50%, but it’s basically all reads.

    If I look at your DB stats, you have 35GBs of indexes and 41GBs of data in 133GBs of allocated files. 133GB is pretty close to your mapped number in mongostat. So the sum of data you may be accessing is about 120GB or about 4x RAM.

    Typically 4x is a perfectly fine ratio. However, in your case, you have indexes exceeding RAM. This tends to be a “falloff” point for performance in MongoDB.

    If you’re accessing randomly across the index, then most or all of the index is in memory. This means that most of your data is not in memory and needs to be “paged in” from disk. You can see this in the heavy disk reads that you’re getting.

    I know you say that you tested with sharding, do you have numbers for those tests? Was the data correctly spread across all three shards?

    Sharding should alleviate your problem as you’re “adding more RAM” to the DB, but you need to confirm that the data is indeed sharded evenly and behaving correctly or it can’t fix your issue.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

For some reason, after submitting a string like this Jack’s Spindle from a text
I am currently running into a problem where an element is coming back from
I'm parsing an RSS feed that has an ’ in it. SimpleXML turns this
Does anyone know how can I replace this 2 symbol below from the string
I have a string like this: La Torre Eiffel paragonata all’Everest What PHP function
link Im having trouble converting the html entites into html characters, (&# 8217;) i
That's pretty much it. I'm using Nokogiri to scrape a web page what has
this is what i have right now Drawing an RSS feed into the php,
I have a French site that I want to parse, but am running into
Seemingly simple, but I cannot find anything relevant on the web. What is the

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.