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 8537211
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T10:50:48+00:00 2026-06-11T10:50:48+00:00

I have a sharded cluster which is set up , Since my data is

  • 0

I have a sharded cluster which is set up , Since my data is seamlessly growing , I need to keep monitoring the size of data and add new shards to the cluster .

Is there a command that I could use to know how much size is utilized in each sharded server , at any point of time .

For eg . lets say I have a database , and my show dbs command from mongos console shows like this

mongos> show dbs
company 0.375GB
config  0.046875GB
test    0.0625GB

I want to know how much data is used in each shard servers . for company database .

my implemented architecture is as follows

I have a single database sharded , in which each collection is sharded .
3 shard servers running mongod instances
1 server running mongos
1 server running config instance

My whole application layer is talking to mongos directly .

I need to know this because , I am planning to build a cron which checks the available size of the shard server and if it exceeds some amount it will send a notification to administrator to show some attention .

Thanks in advance for responding to this post

  • 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-06-11T10:50:49+00:00Added an answer on June 11, 2026 at 10:50 am

    After posting in the mongoDB user group , I got the solution on how we need to do this and what commands that could be used

    Commands

    To know about space utilization of a particular DB in each sharded server we have to use

    db.stats() 
    

    to know about space utilization of a particular Collection in each sharded server we have to use

    db.<collectionname>.stats()
    

    Now to use it in the php daemon/cron I could call these commands using php mongo driver

    $con= new Mongo()
    
    $stats=$con->dbName->command(array('dbStats' => 1));  // for db.stats()
    

    $stats=$con->dbName->command(array('collStats' => 'collection_name'));

    Still I couldn’t find any method to execute such commands from Zend shanty mongo but I could use default PHP pecl mongo db driver to achieve this

    Thank you all for responding to this post

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

Sidebar

Related Questions

I have a sharded cluster which has a replica set sharded, my application layer
I have a 200gb data base on a sharded four node cluster and and
I am having trouble understanding this issue - I have a sharded cluster in
We have an application which is set up on IIS7 on Server 2008 R2
I have a database that is currently sharded. This is the first time that
I have shared object A.so which statically links to libssl.a & another shared object
I have a file which compiles without errors or warnings on my macbook pro
I am new to Java and junit. I have the following peice of code
I'm going through the Sharded Counters example in Java: http://code.google.com/appengine/articles/sharding_counters.html I have a question
For an online marketplace product under construction, I have a situation which requires implementing

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.