cannot create more threads.

dragoniidragonii Member rains wangOrganization: system designProject: Server Manager
Hi

In the program, I want to run 200 threads concurrently, but in the client side, after create about 50 threads, it cannot create more, and print out the following messages:
08/19/10 07:07:41.202 ./ThreadClient: error: fatal error: can't accept more connections:
Network.cpp:1273: Ice::SocketException:
socket exception: Too many open files
0.0.0.0:33079
Aborted

I don't have any file operations in the program.

I'm using CentOS 4.8
Ice 3.3.1

Before running the Client, I set
ulimit -s 4096
Now I really don't know how to handle this problem, thanks for giving any help:)

Comments

  • ntsjunntsjun Member Jun SuOrganization: self employedProject: webapp written in java invoke .net program
    Did you open too many files or net connection ? Check your code carefully, it seems some opend file or connection does't be closed.
  • dragoniidragonii Member rains wangOrganization: system designProject: Server Manager
    ntsjun wrote: »
    Did you open too many files or net connection ? Check your code carefully, it seems some opend file or connection does't be closed.

    No file operations in my code, and only one connection in one thread.


    Thanks
  • bernardbernard Jupiter, FLAdministrators, ZeroC Staff Bernard NormierOrganization: ZeroC, Inc.Project: Ice ZeroC Staff
    Hi Rains,

    I don't really understand what you're doing. And you should upgrade to Ice 3.4!
    dragonii wrote: »
    Hi

    In the program, I want to run 200 threads concurrently, but in the client side, after create about 50 threads, it cannot create more, and print out the following messages:
    08/19/10 07:07:41.202 ./ThreadClient: error: fatal error: can't accept more connections:
    Network.cpp:1273: Ice::SocketException:
    socket exception: Too many open files
    0.0.0.0:33079
    Aborted
    

    Is your ThreadClient really a server that creates lots of object adapters (one per thread??) Doesn't sound right.
    Before running the Client, I set
    ulimit -s 4096
    

    ulimit -s sets the stack size. How is this relevant here? ulimit -n and ulimit -u would be more interesting here.

    Best regards,
    Bernard
Sign In or Register to comment.