Performance about TCPIP and threads

Performance about TCPIP and threads

Post by Malvin » Sun, 22 Jun 2003 14:10:50



Hi, every one.

I have an instesting question:
Our system On Sol8 has three processes which communicate via TCPIP:
A --> B ---> C

The B process spawn a new thread to handle the data from A, and
A and C handle the data using only a thread.

The result is when I send many data packages (every one is about 200 Bytes)
from A to B. B seems NOT handle the packages as soon as the packages arrive,
and the data are accumulated at the B process.

But the serious problems is that the CPU usage is low , about 50%.

Can any one explain it?

Thanks a lot.

 
 
 

Performance about TCPIP and threads

Post by Anthony Mandi » Sun, 22 Jun 2003 15:55:10



> I have an instesting question:
> Our system On Sol8 has three processes which communicate via TCPIP:
> A --> B ---> C

> The B process spawn a new thread to handle the data from A, and
> A and C handle the data using only a thread.

> The result is when I send many data packages (every one is about 200 Bytes)
> from A to B. B seems NOT handle the packages as soon as the packages arrive,
> and the data are accumulated at the B process.

> But the serious problems is that the CPU usage is low , about 50%.

> Can any one explain it?

        Sounds like the Nagle algorithm. Look at setting tcp no delay.

-am     ? 2003

 
 
 

Performance about TCPIP and threads

Post by Malvin » Tue, 24 Jun 2003 14:04:12




> > I have an instesting question:
> > Our system On Sol8 has three processes which communicate via TCPIP:
> > A --> B ---> C

> > The B process spawn a new thread to handle the data from A, and
> > A and C handle the data using only a thread.

> > The result is when I send many data packages (every one is about 200 Bytes)
> > from A to B. B seems NOT handle the packages as soon as the packages arrive,
> > and the data are accumulated at the B process.

> > But the serious problems is that the CPU usage is low , about 50%.

> > Can any one explain it?

>    Sounds like the Nagle algorithm. Look at setting tcp no delay.

> -am        ? 2003

Thanks very much, after I set_option for the TCP_NODELAY,
the system is normal, and handles the packages quickly.

But I am wondering whether it means that to communicate using TCPIP on
the same host is not suitable?

 
 
 

Performance about TCPIP and threads

Post by Alan Coopersmit » Tue, 24 Jun 2003 14:13:07



|But I am wondering whether it means that to communicate using TCPIP on
|the same host is not suitable?

It'll work, but there are probably faster ways.  Check out Unix Network
Programming, 2nd Ed. Vol 2.

--
________________________________________________________________________


  Working for, but definitely not speaking for, Sun Microsystems, Inc.

 
 
 

1. Performance improvements binding threads to CPUs or thread priorities

I'm using a SunOS 5.8 Generic_108528-12 sun4u sparc SUNW,Ultra-60 -
which has 2 CPUs.  In my case, there is a c++ application that
consists of several worker threads that are responsible for heavy
computations, and several other threads for receiving data via udp and
tcp, and another thread for sending results via tcp.

1. Can someone point out some advantages of binding a thread/lwp to a
cpu? I'm looking for some docs, or concrete cases of when this would
be beneficial. I tried using processor_bind() in a sample test, but
could not see performance gains.

2. I tried to increase the priority of the computational threads, and
likewise did not see any performance improvement. Can anyone suggest
ways I can leverage priority scheduling for the above application ?

MR

2. RealTek RTL8139 Fast Ethernet driver hangs

3. OS/2 TCPIP and Linux TCPIP

4. Help with the mknod command

5. TCPIP performance

6. Documents

7. Matrox Mystique ands X.

8. umask/mode

9. Threads, threads, threads

10. Threads in linux versus threads in NT and threads in Solaris.

11. threads packages: kernel threads vs. user threads

12. POSIX threads, thread-specific data: what about the "main" thread?