SitePoint Sponsor

User Tag List

Results 1 to 14 of 14
  1. #1
    SitePoint Guru
    Join Date
    Feb 2007
    Posts
    874
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Socket Listener Limits

    Dear All,
    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?

  2. #2
    SitePoint Zealot
    Join Date
    Aug 2007
    Posts
    123
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    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.

  3. #3
    SitePoint Guru
    Join Date
    Feb 2007
    Posts
    874
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Dear Sumit,
    Currently I listen to only a particular port. So all device will link on that IP and Port. So what is your advice?

  4. #4
    SitePoint Zealot
    Join Date
    Apr 2005
    Location
    London
    Posts
    163
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    there can be operating system limits.. which OS are you using?

  5. #5
    SitePoint Guru
    Join Date
    Feb 2007
    Posts
    874
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Dear Jurn,
    I am using Cetos 5.5 any comments on that? What limit can the OS have?

  6. #6
    SitePoint Zealot
    Join Date
    Aug 2007
    Posts
    123
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    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: -

    http://www.cyberciti.biz/faq/linux-i...of-open-files/

  7. #7
    SitePoint Guru
    Join Date
    Feb 2007
    Posts
    874
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Dear Sumit,
    Will there be any other limitation such the port or sockets or thread? So what else must I tweak?

  8. #8
    SitePoint Zealot
    Join Date
    Aug 2007
    Posts
    123
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    nopes..as far as OS goes its only FD's which needs to be considered

  9. #9
    SitePoint Guru
    Join Date
    Feb 2007
    Posts
    874
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Dear Sumit,
    There are few different types of settings which one should I apply and what limit should I set? Currently is 1024.

  10. #10
    SitePoint Zealot
    Join Date
    Aug 2007
    Posts
    123
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    where do u see 1024 as the limit?

    User level FD's Limits are defined in = vi /etc/security/limits.conf
    And
    System level FD limits are defined in = vi /etc/sysctl.conf

    Please follow this link (http://www.cyberciti.biz/faq/linux-i...of-open-files/) it tells the step by step process to modify the limits for User FD's and System FD's

  11. #11
    SitePoint Guru
    Join Date
    Feb 2007
    Posts
    874
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Dear Sumit,
    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.
    Quote Originally Posted by sumit1001 View Post
    where do u see 1024 as the limit?

    User level FD's Limits are defined in = vi /etc/security/limits.conf
    And
    System level FD limits are defined in = vi /etc/sysctl.conf

    Please follow this link (http://www.cyberciti.biz/faq/linux-i...of-open-files/) it tells the step by step process to modify the limits for User FD's and System FD's

  12. #12
    SitePoint Zealot
    Join Date
    Aug 2007
    Posts
    123
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    It is always better to define the User level FD's...Do the following

    1. Login as root
    2. open "vi /etc/security/limits.conf"
    3. 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.

    4. Save the file, logout and login again and then type ulimit -n

  13. #13
    SitePoint Guru
    Join Date
    Feb 2007
    Posts
    874
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Dear Sumit,
    So what is the limit for settings is it based on my memory? Is 100000 a ok number to set?
    Quote Originally Posted by sumit1001 View Post
    It is always better to define the User level FD's...Do the following

    1. Login as root
    2. open "vi /etc/security/limits.conf"
    3. 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.

    4. Save the file, logout and login again and then type ulimit -n

  14. #14
    SitePoint Zealot
    Join Date
    Aug 2007
    Posts
    123
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    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?


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •