Hi Ricardo,
This is due to ulimit settings. On most Linux systems there are limits on how many files/sockets you can open. By default this is 1024.
Applications that require more than this are generally started as root, with a higher ulimit set then drop back to the user account.
This example script should explain:
[root@x ~]# ./ulimit_test.sh
Inside startup script:
I am running as root and I have 1024 sockets available.
Setting ulimit...
I am running as root and I have 10240 sockets available.
Switching to user...
I am running as dan and I have 10240 sockets available.
[root@x ~]#
[root@x ~]# cat ulimit_test.sh
#!/bin/bash
echo "Inside startup script:"
/tmp/daemon.sh
echo "Setting ulimit..."
ulimit -n 10240
/tmp/daemon.sh
echo "Switching to user..."
su - dan -c /tmp/daemon.sh
[root@x ~]# cat /tmp/daemon.sh
#!/bin/bash
echo "I am running as $( id -un ) and I have $( ulimit -n ) sockets available.";
Obviously you would only need a start up script with the ulimit -n 10240 and su - <user> -c <command> :)
I hope that makes sense!
Cheers,
DanB.
> --
>
> You received this message because you are subscribed to the Google Groups "nodejs" group.
> To post to this group, send email to
nod...@googlegroups.com.
> To unsubscribe from this group, send email to
nodejs+un...@googlegroups.com.
> For more options, visit this group at
http://groups.google.com/group/nodejs?hl=en.
>
>