public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Arnaldo Carvalho de Melo <acme@conectiva.com.br>
To: Pete Marvin King <pmking@ntsp.nec.co.jp>
Cc: "linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: Re: socket problem
Date: Fri, 24 Aug 2001 01:23:32 -0300	[thread overview]
Message-ID: <20010824012332.B1022@conectiva.com.br> (raw)
In-Reply-To: <3B864198.9E132BFB@ntsp.nec.co.jp>
In-Reply-To: <3B864198.9E132BFB@ntsp.nec.co.jp>; from pmking@ntsp.nec.co.jp on Fri, Aug 24, 2001 at 11:59:21AM +0000

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

  reply	other threads:[~2001-08-24  4:23 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-08-24 11:59 socket problem Pete Marvin King
2001-08-24  4:23 ` Arnaldo Carvalho de Melo [this message]
  -- strict thread matches above, loose matches on Subject: below --
2001-08-24  4:36 Dan Kegel

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20010824012332.B1022@conectiva.com.br \
    --to=acme@conectiva.com.br \
    --cc=linux-kernel@vger.kernel.org \
    --cc=pmking@ntsp.nec.co.jp \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox