A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://stackoverflow.com/questions/1635747/backlog-value-in-listen-system-call below:

c - backlog value in listen system call

I have a doubt regarding the backlog value in listen system call. From man page of listen system call.

If the backlog argument is greater than the value in /proc/sys/net/core/somaxconn, then it is silently truncated to that value; the default value in this file is 128.

It means my server can accept only <128 connections at once. What if I want to accept more connection >128 ?? Can I simply set the value to the possible maximum number so that I can access more number of connection ??

Guy Avraham

3,74233 gold badges4242 silver badges5454 bronze badges

asked Oct 28, 2009 at 7:58

codingfreakcodingfreak

4,5951111 gold badges5252 silver badges6161 bronze badges

That number is only the size of the connection queue, where new connections wait for somebody to accept them. As soon as your application calls accept(), a waiting connection is removed from that queue. So, you can definitely handle more than 128 simultaneous connections because they usually only spend a short time in the queue.

answered Oct 28, 2009 at 8:09

Greg HewgillGreg Hewgill

1.0m192192 gold badges1.2k1.2k silver badges1.3k1.3k bronze badges

1

Yes. Use a command such as

$ echo 1000 >/proc/sys/net/core/somaxconn

To set the limit higher. See, for instance, this page for more tuning tips.

answered Oct 28, 2009 at 8:01

unwindunwind

401k6464 gold badges490490 silver badges619619 bronze badges

2

The backlog value is not the number of maximum connections, it's the number of outstanding connections, i.e connections which you havn't accept():ed.

answered Oct 28, 2009 at 8:11

PuppePuppe

5,16511 gold badge2929 silver badges2828 bronze badges

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4