linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Re: socket problem
  2001-08-24 11:59 socket problem Pete Marvin King
@ 2001-08-24  4:23 ` Arnaldo Carvalho de Melo
  0 siblings, 0 replies; 3+ messages in thread
From: Arnaldo Carvalho de Melo @ 2001-08-24  4:23 UTC (permalink / raw)
  To: Pete Marvin King; +Cc: linux-kernel

Em Fri, Aug 24, 2001 at 11:59:21AM +0000, Pete Marvin King escreveu:
> 
>     Is it possible to increase the maximum sockets that can be opened
> simultaneously?
> I'd like it to reach 1024, is it possible?
> 
>     I'm currently doing a stress test on postgres. we created a dummy
> client that would
> connect to it 1024 times. But is just stops at 324,
> postgres reports : " postmaster: StreamConnection: accept: Too many open
> files in system".
> 
>     I don't think the problem is not with the file descriptors. Is it
> the max num of sockets?
> or maybe the maximum number of files that can be opened?
> 
>     Any help would be greatly appreciated.

increase te max number of fds in /proc/sys/fs/file-max and in ulimit -n

[root@brinquedo /root]# cat ~acme/max_sockets.c
#include <sys/types.h>
#include <sys/socket.h>

int main(void)
{
        int nr_sockets = 0;

        while(socket(PF_INET, SOCK_STREAM, 0) > 0)
                ++nr_sockets;
        printf("nr_sockets=%d\n", nr_sockets);
        return 0;
}
[root@brinquedo /root]# ulimit -n
4096
[root@brinquedo /root]# ./max_sockets
nr_sockets=4093
[root@brinquedo /root]# ulimit -n 8192
[root@brinquedo /root]# ./max_sockets
nr_sockets=7600
[root@brinquedo /root]# ulimit -n 16384
[root@brinquedo /root]# ./max_sockets
nr_sockets=7601
[root@brinquedo /root]# cat /proc/sys/fs/file-max
8192
[root@brinquedo /root]# echo 20000 > /proc/sys/fs/file-max
[root@brinquedo /root]# ./max_sockets
nr_sockets=16381

- Arnaldo

^ permalink raw reply	[flat|nested] 3+ messages in thread

* socket problem
@ 2001-08-24 11:59 Pete Marvin King
  2001-08-24  4:23 ` Arnaldo Carvalho de Melo
  0 siblings, 1 reply; 3+ messages in thread
From: Pete Marvin King @ 2001-08-24 11:59 UTC (permalink / raw)
  To: linux-kernel


    Is it possible to increase the maximum sockets that can be opened
simultaneously?
I'd like it to reach 1024, is it possible?

    I'm currently doing a stress test on postgres. we created a dummy
client that would
connect to it 1024 times. But is just stops at 324,
postgres reports : " postmaster: StreamConnection: accept: Too many open
files in system".

    I don't think the problem is not with the file descriptors. Is it
the max num of sockets?
or maybe the maximum number of files that can be opened?

    Any help would be greatly appreciated.

    I'm using slackware 7.1 - linux 2.4.5

thanx,
marvin




^ permalink raw reply	[flat|nested] 3+ messages in thread

* re: socket problem
@ 2001-08-24  4:36 Dan Kegel
  0 siblings, 0 replies; 3+ messages in thread
From: Dan Kegel @ 2001-08-24  4:36 UTC (permalink / raw)
  To: Pete Marvin King, linux-kernel

> Is it possible to increase the maximum sockets that can be opened
> simultaneously?
> I'd like it to reach 1024, is it possible?
> 
>     I'm currently doing a stress test on postgres. we created a dummy
> client that would connect to it 1024 times. But is just stops at 324,
> postgres reports : " postmaster: StreamConnection: accept: Too many open
> files in system".
> 
>     I don't think the problem is not with the file descriptors. Is it
> the max num of sockets?
> or maybe the maximum number of files that can be opened?

see http://www.kegel.com/c10k.html#limits.filehandles

You may need to raise ulimit, or perhaps /proc/sys/fs/file-max
- Dan

-- 
"I have seen the future, and it licks itself clean." -- Bucky Katt

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2001-08-24  4:37 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2001-08-24 11:59 socket problem Pete Marvin King
2001-08-24  4:23 ` Arnaldo Carvalho de Melo
  -- strict thread matches above, loose matches on Subject: below --
2001-08-24  4:36 Dan Kegel

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).