netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Dragoslav Zaric <dragoslav.zaric.kd@gmail.com>
To: netdev@vger.kernel.org
Subject: Socket Server breaks after 1000 client requests
Date: Thu, 31 Dec 2009 20:11:15 +0100	[thread overview]
Message-ID: <2d05c4580912311111w6abaa007y5d212dd8fbde24d9@mail.gmail.com> (raw)

Hi,

I wrote C++ Socket class. This class wraps methods both for client and server,
so you can create server or client depending what methods you call.

Anyway, all in all, problem is:

I have 3 small programs. One is server that listens in loop on port 30000.
Second is client program that sends one message to the server.
The third one on is small program (called spawn) that forks and
executes client program in limited for loop. So , idea is to simulate
a lot of connections to the server and see how many he can handle and
how.

So, at first I start server, execute spawn, and server gets client
messages. First I try 10 clients, then 100, then 1000 and it worked
Then I tried 10000 clients, and then it breaks just above 1000
clients, plus minus 100 !! So then I tried to put in server code 5
threads and mutex, but the result is same around 1000 clients and
breaks. Then I put semaphore, but then i realized that in this
scenario semaphores are of no use, because you can not sync with
random client events.

I also tried to change value in listen() method, but then I read
somewhere that maximum is 5 connections, which is default.

Does this problem requires some change in kernel code, or tcp/ip
stack, or the solution is simple, like reset server when it has first
break. I tried this last solution, but nothing happens.

So , does anyone have any idea?

Please help, I am working on this for days

thanks

             reply	other threads:[~2009-12-31 19:11 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-12-31 19:11 Dragoslav Zaric [this message]
2009-12-31 19:22 ` Socket Server breaks after 1000 client requests Ben Greear
2010-01-08 17:24   ` Dragoslav Zaric

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=2d05c4580912311111w6abaa007y5d212dd8fbde24d9@mail.gmail.com \
    --to=dragoslav.zaric.kd@gmail.com \
    --cc=netdev@vger.kernel.org \
    /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;
as well as URLs for NNTP newsgroup(s).