[SERVER-7022] File Descriptor Configuration for MongoDB Deployment Created: 12/Sep/12  Updated: 18/Dec/12  Resolved: 04/Oct/12

Status: Closed
Project: Core Server
Component/s: Sharding
Affects Version/s: 2.0.3
Fix Version/s: None

Type: Question Priority: Minor - P4
Reporter: jitendra Assignee: Barrie Segal
Resolution: Incomplete Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

Linux OEL


Issue Links:
Duplicate
is duplicated by SERVER-7911 Error "too many open file" Closed
Participants:

 Description   

Hi,

I read the link on mongo db site regarding "Too many open files". (http://www.mongodb.org/display/DOCS/Too+Many+Open+Files)
My MongoDB Setup is:
1. 1 MongoS, 3 MongoC, 10 MongoD
2. All MongoDs are running on one server.
3. On MongoD I am using "--smallfiles" which creates files of maximum 512 MB on disk.
4. Total disk for all 10 shards is 15TB i.e. 1.5 TB per shard.
5. At a time total 365 databases are present in the system.

According to mongodb the formula is:
//TotalSize = `du -gs <db-path> | cut -f 1`

  1. = (TotalSizeGB/2) + (NumberOfDBs) + (max(maxConns, 20,000)) + 5%-overhead
    I calculated file descriptor value for my deployment using above formula. Calculation is:
  1. = (15 * 1024)/2 + 365*10 + 20,000 + 5% = 32896

My purpose for asking this question is: I set file descriptor value as 35000 on my server.
But still I am getting "Too Many Open files" error. And this error is coming frequently. (One case which I have seen is when running show dbs command)
So Should file descriptor value in my deployment be:

Since filesize in my case is 512 MB instead of 2048 MB(Default) so multiplying TotalSizeGB by 4:

  1. = (15 * 1024 * 4)/2 + 365*10 + 20,000 + 5% = 57088

T&R,
jitendra verma



 Comments   
Comment by Ian Whalen (Inactive) [ 18/Dec/12 ]

jitendra, for general questions such as this please begin a discussion in our forums at https://groups.google.com/forum/?fromgroups#!forum/mongodb-user

if that conversation turns to confirmation you have found a bug, please open a bug here.

Comment by jitendra [ 18/Dec/12 ]

Hi ,
Please updates
Thanks,
JRV

Comment by jitendra [ 13/Dec/12 ]

Hi,

We were running with file descriptor setting of 64000 for root user. ulimit -a shows 64000 whereas fs.file-max is 1601695.
We are still getting "Too many open files".

I have a confusion in max connection in the above formula.
I have 10 mongod processes(shards), 3 mongod config server processes and 1 mongos process running on ONE SYSTEM.

In the above formula, the (max(maxConns, 20,000)) is for one mongo process or overall for system?
Meaning Based on connections, should I consider file descriptor limit for system as 20,000 or 280,000(20000 * 14 (mongod, mongos and mongoc))

Comment by Barrie Segal [ 04/Oct/12 ]

Hi Jitendra,

I'm closing this out. Please feel free to reopen it if you have further questions about this.

Thanks,

Barrie

Comment by Eliot Horowitz (Inactive) [ 15/Sep/12 ]

How many files do you have?

Comment by Barrie Segal [ 12/Sep/12 ]

Hi Jitendra,

The Core Server project is generally meant for filing feature requests and bug reports. If you'd like someone to help troubleshoot an issue, please file a ticket in our Google Group here.

Thanks,

Barrie

Comment by jitendra [ 12/Sep/12 ]

Hi ,
Please updates

Thanks,
JRV

Generated at Thu Feb 08 03:13:25 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.