mongodb spawning tons of find processes

26 views
Skip to first unread message

Saksham Ghimire

unread,
Jul 2, 2015, 11:04:22 AM7/2/15
to mongod...@googlegroups.com
Hi,

I have been seeing tons of find processes being spawned
by mongo. How does this occur and what can I do to avoid them in my code? I am using mongojs with nodejs.

root    
32053     1  0 Jun29 ?        00:11:34 find -L / ( -ipath /.git -prune -or -ipath /node_modules -prune -or
root    
32066     1  0 Jun29 ?        00:11:31 find -L / ( -ipath /.git -prune -or -ipath /node_modules -prune -or
root    
32081     1  0 Jun29 ?        00:11:30 find -L / ( -ipath /.git -prune -or -ipath /node_modules -prune -or
root    
32084     1  0 Jun29 ?        00:11:30 find -L / ( -ipath /.git -prune -or -ipath /node_modules -prune -or
root    
32087     1  0 Jun29 ?        00:11:31 find -L / ( -ipath /.git -prune -or -ipath /node_modules -prune -or
root    
32091     1  0 Jun29 ?        00:11:30 find -L / ( -ipath /.git -prune -or -ipath /node_modules -prune -or
root    
32095     1  0 Jun29 ?        00:11:30 find -L / ( -ipath /.git -prune -or -ipath /node_modules -prune -or
root    
32098     1  0 Jun29 ?        00:11:24 find -L / ( -ipath /.git -prune -or -ipath /node_modules -prune -or
root    
32105     1  0 Jun29 ?        00:11:18 find -L / ( -ipath /.git -prune -or -ipath /node_modules -prune -or
root    
32113     1  0 Jun29 ?        00:11:14 find -L / ( -ipath /.git -prune -or -ipath /node_modules -prune -or
root    
32121     1  0 Jun29 ?        00:11:10 find -L / ( -ipath /.git -prune -or -ipath /node_modules -prune -or
root    
32139     1  0 Jun29 ?        00:11:04 find -L / ( -ipath /.git -prune -or -ipath /node_modules -prune -or
root    
32147     1  0 Jun29 ?        00:11:01 find -L / ( -ipath /.git -prune -or -ipath /node_modules -prune -or
root    
32154     1  0 Jun29 ?        00:10:57 find -L / ( -ipath /.git -prune -or -ipath /node_modules -prune -or
root    
32162     1  0 Jun29 ?        00:10:56 find -L / ( -ipath /.git -prune -or -ipath /node_modules -prune -or
root    
32185     1  0 Jun29 ?        00:10:51 find -L / ( -ipath /.git -prune -or -ipath /node_modules -prune -or
root    
32193     1  0 Jun29 ?        00:10:49 find -L / ( -ipath /.git -prune -or -ipath /node_modules -prune -or
root    
32202     1  0 Jun29 ?        00:10:47 find -L / ( -ipath /.git -prune -or -ipath /node_modules -prune -or
root    
32211     1  0 Jun29 ?        00:10:41 find -L / ( -ipath /.git -prune -or -ipath /node_modules -prune -or
root    
32218     1  0 Jun29 ?        00:10:39 find -L / ( -ipath /.git -prune -or -ipath /node_modules -prune -or
root    
32240     1  0 Jun29 ?        00:10:35 find -L / ( -ipath /.git -prune -or -ipath /node_modules -prune -or
root    
32253     1  0 Jun29 ?        00:10:30 find -L / ( -ipath /.git -prune -or -ipath /node_modules -prune -or
root    
32275     1  0 Jun29 ?        00:10:24 find -L / ( -ipath /.git -prune -or -ipath /node_modules -prune -or
root    
32291     1  0 Jun29 ?        00:10:22 find -L / ( -ipath /.git -prune -or -ipath /node_modules -prune -or
root    
32319     1  0 Jun29 ?        00:10:15 find -L / ( -ipath /.git -prune -or -ipath /node_modules -prune -or
root    
32328     1  0 Jun29 ?        00:10:14 find -L / ( -ipath /.git -prune -or -ipath /node_modules -prune -or
root    
32343     1  0 Jun29 ?        00:10:07 find -L / ( -ipath /.git -prune -or -ipath /node_modules -prune -or
root    
32370     1  0 Jun29 ?        00:10:04 find -L / ( -ipath /.git -prune -or -ipath /node_modules -prune -or
root    
32400     1  0 Jun29 ?        00:09:55 find -L / ( -ipath /.git -prune -or -ipath /node_modules -prune -or



Stephen Steneker

unread,
Jul 2, 2015, 11:17:25 AM7/2/15
to mongod...@googlegroups.com, gsa...@gmail.com
On Friday, 3 July 2015 01:04:22 UTC+10, Saksham Ghimire wrote:
I have been seeing tons of find processes being spawned by mongo. How does this occur and what can I do to avoid them in my code? I am using mongojs with nodejs.

root    
32053     1  0 Jun29 ?        00:11:34 find -L / ( -ipath /.git -prune -or -ipath /node_modules -prune -or
root    
32066     1  0 Jun29 ?        00:11:31 find -L / ( -ipath /.git -prune -or -ipath /node_modules -prune -or
...

Hi Saksham,

The processes that are being spawned here are unrelated to the MongoDB driver or server.

It looks like you have something going awry in your application code, but that's probably a better question to post on StackOverflow (tagged as a Node.js question including example code where the find is being invoked).

This could also be an approach one of the modules you are loading uses to discover what local packages you have installed (although it seems unusual to rely on the system find utility).

Regards,
Stephen

Saksham Ghimire

unread,
Jul 6, 2015, 3:37:45 PM7/6/15
to mongod...@googlegroups.com, gsa...@gmail.com
I found the issue. NODEMON plugin for nodejs was trigerring all those find processes.
s per discussion on github, make the following changes to avoid nodemon trying to find the following directories:

nodemon/lib/config/defaults.js

ignore: ['.git/', 'node_modules/', 'bower_components/', '.sass-cache/'],
Reply all
Reply to author
Forward
0 new messages