linux disk space usage for mongodb in /var

139 views
Skip to first unread message

Lance Lyons

unread,
Jun 8, 2016, 11:32:12 AM6/8/16
to mongodb-user
Im a little new to Mongodb but we have mongodb setup on a Centos Linux box and our collections are getting larger.   The mongo db data path folder is on /data/mongo with /data being its own disk.

We can see the collections and files in this folder.

However mongo seems to be using space in the /var folder but when I do a du -h on the /var folder it shows a total of 800m.   The /var disk is 10G for us.

Somehow the /var disk is filling up and when I stop mongo  (service mongod stop and then  service mongod start) it frees up all the disk space that was used in /var

any ideas what space mongod might be using in /var?    Could this just be a swap file under /var that gets reduced when recycling the mongod service?


Thanks in advance.
Message has been deleted

Amar

unread,
Jun 15, 2016, 9:54:56 PM6/15/16
to mongodb-user

Hi Lance,


I would suggest checking which file system is used for swap and how much swap is used:

# cat /proc/swaps

If those values correspond to the usage that you have seen under /var then you could use tools to check which process is using swap. An example would be smem which would show how much swap (as well as physical memory) is used by which program.

# smem

However mongo seems to be using space in the /var folder but when I do a du -h on the /var folder it shows a total of 800m

Does the value of 800MB correspond to the total usage on /var that you see? What are the specific files that led you to believe they are owned by mongod?

If you still require assistance, please provide:

  • MongoDB version and storage engine
  • Linux distro
  • The commands and their output listed above
  • The command and output used to check usage of /var

Regards,

Amar

Reply all
Reply to author
Forward
0 new messages