You are not logged in.

#1 2010-02-23 22:44:43

eDio
Member
From: Ukraine, Kyiv
Registered: 2008-12-02
Posts: 422

Is there any limit on number of connections?

Hello.

I've noticed, that kopete disconnecting while my torrent client is running (qtorrent).
There was allowed up to 500 connections in qtorrent.
Then I've lowered this number to 100 and now kopete seems to work very well.

So to approve or reject my suspicions about qTorrent I want to know, if there is some limit on number of connections and how to know exact number of allowed connections.

Thanks in advance.

Offline

#2 2010-02-23 23:08:52

fukawi2
Ex-Administratorino
From: .vic.au
Registered: 2007-09-28
Posts: 6,237
Website

Re: Is there any limit on number of connections?

Maximum conntrack connections can be found here:

cat /proc/sys/net/nf_conntrack_max

Current connections in the conntrack table can be found here:

cat /proc/net/ip_conntrack

This page should give you some more information:
http://lserinol.blogspot.com/2009/02/ip … limit.html

Last edited by fukawi2 (2010-02-23 23:09:04)

Offline

#3 2010-02-24 00:34:41

thestinger
Package Maintainer (PM)
From: Toronto, Canada
Registered: 2010-01-23
Posts: 478

Re: Is there any limit on number of connections?

Most home routers can't maintain over 150-300 connections though

Offline

#4 2010-02-24 19:55:29

eDio
Member
From: Ukraine, Kyiv
Registered: 2008-12-02
Posts: 422

Re: Is there any limit on number of connections?

There are no /proc/sys/net/nf_conntrack_max  and  /proc/net/ip_conntrack on my system.
There are following folders though with lots of subfolders:

/proc/sys/net/bridge/
/proc/sys/net/core/
/proc/sys/net/ipv4/
/proc/sys/net/ipv6/
/proc/sys/net/netfilter/
/proc/sys/net/unix/

2thestinger
There is not a router issue. In Windows® there is limit on number of half-opened connections, and I guess, that must be something the same in Linux. And I want to know this limit, if it exists.

Offline

#5 2010-02-24 21:59:36

fukawi2
Ex-Administratorino
From: .vic.au
Registered: 2007-09-28
Posts: 6,237
Website

Re: Is there any limit on number of connections?

eDio wrote:

There are no /proc/sys/net/nf_conntrack_max  and  /proc/net/ip_conntrack on my system.

Really? And you're using Arch? What kernel? hmm

Try this:

find /proc -name \*conntrack_max

Offline

#6 2010-02-24 22:31:39

Ultraman
Member
Registered: 2009-12-24
Posts: 242

Re: Is there any limit on number of connections?

fukawi2 wrote:
eDio wrote:

There are no /proc/sys/net/nf_conntrack_max  and  /proc/net/ip_conntrack on my system.

Really? And you're using Arch? What kernel? hmm

Try this:

find /proc -name \*conntrack_max

Same here by the way. The file is not there. 2.6.32.8 Arch kernel.
That find command also does not return anything over here...

Offline

#7 2010-02-25 02:09:56

fukawi2
Ex-Administratorino
From: .vic.au
Registered: 2007-09-28
Posts: 6,237
Website

Re: Is there any limit on number of connections?

Wow... I'm out then, not sure what's going on,,,

fukawi2@phil-desktop ~  $ cat /proc/sys/net/nf_conntrack_max
65536
fukawi2@phil-desktop ~  $ sudo wc -l /proc/net/ip_conntrack
23 /proc/net/ip_conntrack
fukawi2@phil-desktop ~  $ uname -a
Linux phil-desktop.fukawi2.local 2.6.32-ARCH #1 SMP PREEMPT Fri Jan 29 09:10:49 CET 2010 x86_64 Intel(R) Core(TM)2 Quad CPU Q8400 @ 2.66GHz GenuineIntel GNU/Linux

Last edited by fukawi2 (2010-02-25 02:10:26)

Offline

#8 2010-02-25 05:20:28

eDio
Member
From: Ukraine, Kyiv
Registered: 2008-12-02
Posts: 422

Re: Is there any limit on number of connections?

I'm using Chackra. But it is Arch with kdemod, isn't it?
But I'm using non-vanilla kernel — kernel 2.6.32-ck.

And find /proc -name \*conntrack_max returns nothing.

Here is output of find /proc -name \*max\*

/proc/asound/card1/pcm1c/sub0/prealloc_max      
/proc/asound/card1/pcm1p/sub0/prealloc_max      
/proc/asound/card1/pcm0c/sub0/prealloc_max      
/proc/asound/card1/pcm0p/sub0/prealloc_max      
/proc/asound/card0/pcm2c/sub0/prealloc_max      
/proc/asound/card0/pcm1p/sub0/prealloc_max      
/proc/asound/card0/pcm0c/sub0/prealloc_max      
/proc/asound/card0/pcm0p/sub0/prealloc_max      
/proc/sys/kernel/pid_max                        
/proc/sys/kernel/ngroups_max                    
/proc/sys/kernel/keys/root_maxkeys              
/proc/sys/kernel/keys/root_maxbytes             
/proc/sys/kernel/perf_event_max_sample_rate
/proc/sys/fs/mqueue/queues_max
/proc/sys/fs/mqueue/msg_max
/proc/sys/fs/mqueue/msgsize_max
/proc/sys/net/core/wmem_max
/proc/sys/net/core/rmem_max
/proc/sys/net/core/netdev_max_backlog
/proc/sys/net/core/optmem_max
/proc/sys/net/ipv4/tcp_max_orphans
/proc/sys/net/ipv4/tcp_max_tw_buckets
/proc/sys/net/ipv4/tcp_max_syn_backlog
/proc/sys/net/ipv4/igmp_max_memberships
/proc/sys/net/ipv4/igmp_max_msf
/proc/sys/net/ipv4/inet_peer_maxttl
/proc/sys/net/ipv4/inet_peer_gc_maxtime
/proc/sys/net/ipv4/tcp_max_ssthresh
/proc/sys/net/ipv4/ipfrag_max_dist
/proc/sys/net/ipv6/conf/all/regen_max_retry
/proc/sys/net/ipv6/conf/all/accept_ra_rt_info_max_plen
/proc/sys/net/ipv6/conf/default/regen_max_retry
/proc/sys/net/ipv6/conf/default/accept_ra_rt_info_max_plen
/proc/sys/net/ipv6/conf/lo/regen_max_retry
/proc/sys/net/ipv6/conf/lo/accept_ra_rt_info_max_plen
/proc/sys/net/ipv6/conf/eth0/regen_max_retry
/proc/sys/net/ipv6/conf/eth0/accept_ra_rt_info_max_plen
/proc/sys/net/ipv6/conf/pan0/regen_max_retry
/proc/sys/net/ipv6/conf/pan0/accept_ra_rt_info_max_plen
/proc/sys/net/ipv6/mld_max_msf

Offline

#9 2010-02-25 06:11:30

fukawi2
Ex-Administratorino
From: .vic.au
Registered: 2007-09-28
Posts: 6,237
Website

Re: Is there any limit on number of connections?

I'm guessing those files from from the "nf_conntrack" module which is loaded by iptables... If you manually load the module I'm guessing they'll appear perhaps...?

Offline

#10 2010-02-25 21:04:16

eDio
Member
From: Ukraine, Kyiv
Registered: 2008-12-02
Posts: 422

Re: Is there any limit on number of connections?

And how to load module to iptables?
I've noticed, that there is some libnetfilter_conntrack in repository. Should I install this?

Offline

#11 2010-02-25 21:38:12

fukawi2
Ex-Administratorino
From: .vic.au
Registered: 2007-09-28
Posts: 6,237
Website

Re: Is there any limit on number of connections?

You shouldn't need to... I certainly haven't had to explicitly install it.

You should be able to load the iptables modules just by starting /etc/rc.d/iptables

You might need to copy /etc/iptables/simple.rules to iptables.rules first though

Offline

#12 2010-02-26 01:09:44

graysky
Wiki Maintainer
From: :wq
Registered: 2008-12-01
Posts: 10,732
Website

Re: Is there any limit on number of connections?

$ cat /proc/sys/net/nf_conntrack_max
cat: /proc/sys/net/nf_conntrack_max: No such file or directory

Arch x86_64 up-to-date.

Offline

#13 2010-02-26 01:35:28

Xs1t0ry
Member
From: Canada
Registered: 2007-07-01
Posts: 181

Re: Is there any limit on number of connections?

I also am using the same kernel on arch64 and I don't have these files either. Moreover, when I try to start iptables, I get

Cannot load iptables rules: /etc/iptables/iptables.rules is missing!

Help?

Offline

#14 2010-02-26 01:43:02

anonymous_user
Member
Registered: 2009-08-28
Posts: 3,059

Re: Is there any limit on number of connections?

Like fukawi2 said, you need to copy/rename /etc/iptables/simple.rules to iptables.rules.

Offline

#15 2010-02-26 02:01:20

Xs1t0ry
Member
From: Canada
Registered: 2007-07-01
Posts: 181

Re: Is there any limit on number of connections?

Ah, sorry, I missed that. Works now, thanks!

edit: Hmmm...

$ sudo echo 60 > /proc/sys/net/nf_conntrack_max 
bash: /proc/sys/net/nf_conntrack_max: Permission denied

What is the matter?

Last edited by Xs1t0ry (2010-02-26 02:08:11)

Offline

#16 2010-02-26 02:09:13

fukawi2
Ex-Administratorino
From: .vic.au
Registered: 2007-09-28
Posts: 6,237
Website

Re: Is there any limit on number of connections?

The sudo only applies to the "echo" command, not the redirection... You'll need to become root then issue the command rather than doing it through sudo

Offline

#17 2010-02-26 02:20:43

Xs1t0ry
Member
From: Canada
Registered: 2007-07-01
Posts: 181

Re: Is there any limit on number of connections?

Ah, thank you. What is a reasonable number for nf_conntrack_max? It was 65000~ but I changed it to 100 and then the internet stopped working, so I made it 1000 and now it works again. I guess this is not the same thing as the number of half-open tcp connections? (i.e. which would apply to torrent clients?

Is this change permanent and do I need to daemonize iptables for it to stick?

Offline

#18 2010-02-26 04:09:13

fukawi2
Ex-Administratorino
From: .vic.au
Registered: 2007-09-28
Posts: 6,237
Website

Re: Is there any limit on number of connections?

I would leave it at 65,000.... It is the number of connections (ie src:port <-> dest:port) combinations the kernel will keep track of... For torrents, you want a high number of connections remembered.

Last edited by fukawi2 (2010-02-26 04:09:59)

Offline

#19 2010-02-26 05:28:32

Xs1t0ry
Member
From: Canada
Registered: 2007-07-01
Posts: 181

Re: Is there any limit on number of connections?

Are the number half-open tcp connections a property of torrent clients or your system?

Offline

Board footer

Powered by FluxBB