newtomysql — 2011-09-30T00:05:17-04:00 — #1
I have socket program which listen to many different devices. So I would like to find out what are limitation in order to control the number of devices pointing to it? Any idea?
sumit1001 — 2011-09-30T12:24:45-04:00 — #2
depends upon the number of ports the user can open
The upper limit is 65536 ports and out of these ports 1-1024 are already reserved.
newtomysql — 2011-09-30T12:27:39-04:00 — #3
Currently I listen to only a particular port. So all device will link on that IP and Port. So what is your advice?
jurn — 2011-10-02T16:27:24-04:00 — #4
there can be operating system limits.. which OS are you using?
newtomysql — 2011-10-02T22:27:21-04:00 — #5
I am using Cetos 5.5 any comments on that? What limit can the OS have?
sumit1001 — 2011-10-03T10:14:07-04:00 — #6
the only limitations, is imposed by the number of FD (File Descriptors) a user can open.
How to get this number and increase this number is defined in the below mentioned link: -
newtomysql — 2011-10-03T13:12:45-04:00 — #7
Will there be any other limitation such the port or sockets or thread? So what else must I tweak?
sumit1001 — 2011-10-03T13:18:49-04:00 — #8
nopes..as far as OS goes its only FD's which needs to be considered
newtomysql — 2011-10-03T13:31:34-04:00 — #9
There are few different types of settings which one should I apply and what limit should I set? Currently is 1024.
sumit1001 — 2011-10-04T12:00:28-04:00 — #10
where do u see 1024 as the limit?
User level FD's Limits are defined in = vi /etc/security/limits.conf
System level FD limits are defined in = vi /etc/sysctl.conf
Please follow this link (http://www.cyberciti.biz/faq/linux-increase-the-maximum-number-of-open-files/) it tells the step by step process to modify the limits for User FD's and System FD's
newtomysql — 2011-10-04T21:02:52-04:00 — #11
I have logged in as root then I type this ulimit -n and it gives me 1024. So I am trying to understand better the difference between user level and system level. So in my case which to be adjusted? Thank you.
sumit1001 — 2011-10-05T10:23:02-04:00 — #12
It is always better to define the User level FD's...Do the following
- Login as root
- open "vi /etc/security/limits.conf"
- edit the above file and add below mentioned 2 lines
<username> soft nofile 100000
<username> hard nofile 100000
<username> - It is the name of the user by which you will be running your application.
- Save the file, logout and login again and then type ulimit -n
newtomysql — 2011-10-05T11:52:08-04:00 — #13
So what is the limit for settings is it based on my memory? Is 100000 a ok number to set?
sumit1001 — 2011-10-09T02:40:18-04:00 — #14
8-10 GB can easily handle 100000 sockets but do you think that you will ever reach at 100000 in the whole lifetime of your application?