All of the modifications I made to limits.conf and /etc/pam.d did
their job, as the max file descriptors went up. However, it turns out
that for some reason, upstarts scripts were ignoring these maximums
(or maybe it was the start-stop daemon) and the max was left at 1024.
I tried solving it with the limit no file line in the pre-start script
section, but it seems MongoDB 1.6.5 doesn't work with the limit nofile
line. I needed to put ulimit -n X (where X is the file descriptors you
want) just after the script keyword.
script
ulimit -n 60000
PORT=27027
...
I guess the method using the pre-start block is for later versions of
MongoDB.
Also for note, MongoDB has a hard limit of 20,000 connections, so it
doesn't matter if you set file descriptors higher than that.
Another thing learned: starting and stopping using upstart scripts is
not the same as REstarting. Starting and stopping threw errors on the
limit nofile command, whereas restarting did not.
Hope that helps someone from pounding their head against the wall for
the better part of two days like me.
On Mar 29, 11:23 am, Eugene <
ehdyc...@gmail.com> wrote:
> Oh, as for limits, I set it for every user since the only purpose for
> the server is to be a MongoDB server.
>
> On Mar 29, 10:55 am, Erez Zarum <
e...@icinga.org.il> wrote:
>
> > Do you also have one set for /etc/pam.d/su?
> > Have you set the limits for the mongodb user as well or only for root?
> > try sudo -u mongodb ulimit -a (or under any user mongodb is running on)
>
> > On Tue, Mar 29, 2011 at 7:49 PM, Eugene <
ehdyc...@gmail.com> wrote:
> > > I have the same problem. Currently usingUbuntuMaverick, MongoDB
> > > version 1.6.5. I'm using it for logging by piping Apache logs into a
> > > Perl script using the Perl MongoDB driver. Theconnectionssteadily
> > > increase and after about an hour, the MongoDB stops accepting new
> > >connections.
>
> > > Current maxconnectionsavailable is 1024. I changed settings in /etc/
> > > security/limits.conf to allow 65000 soft and hard limit, which shows
> > > up when I do ulimit -a. However, even after setting up maxConns in
> > > theupstartscript (and adding a limit nofile line in there), MongoDB