* 3.2G to 4.0D Benchmark Comparison
@ 1998-06-18 4:00 Ron Heiby
1998-06-19 4:00 ` Phil Hodges
1998-06-19 4:00 ` Jeff Denham
0 siblings, 2 replies; 6+ messages in thread
From: Ron Heiby @ 1998-06-18 4:00 UTC (permalink / raw)
-----BEGIN PGP SIGNED MESSAGE-----
Hi!
While my firm was running Digital UNIX 3.2G, I ran several benchmark
programs to attempt to determine a number of transactions per second that
might be made through my system, and (more important) the relative speed
of performing certain operations in different ways.
The basic test is to have a client program and a server program that pass
blocks of data back and forth to each other. In each case, the server
establishes a socket connection on which to listen and the client
establishes N connections to the server. Each connection has its own
socket. The client picks a connection at random and sends 1000 bytes on
it. The server receives these 1000 bytes and sends them back on the same
socket on which they were received. When the client receives the 1000
bytes back from the server, it repeats the process. Every second, the
client displays statistical information, basically the number of
transactions (round trips) it was able to accomplish in the last second,
plus total and moving averages.
There are different versions of the server. One version uses a single
process and a single thread in that process, handling all N socket
connections using select(2). Another creates a thread for each socket, and
each thread does a blocking read on its socket, waiting for something to
do. Another version of that threaded server (and modified client) use
AF_LOCAL (AF_UNIX) sockets, instead of AF_INET sockets. In each test, both
client and server are on the same machine.
Each test is run for at least ten minutes with each of various numbers of
socket connections (1, 2, 4, 8, 16, 32, 64, 128, 256, 512, 1024, 2000).
(Why 2000, rather than 2048, you ask? Well, the thread approach runs out
of system memory on my 128 Meg machine before I reach 2048 under 3.2G.
Under 4.0D, I run out of memory a bit sooner.) The tests are run when the
system is otherwise (basically) idle. The tests are run for at least ten
minutes, with the average throughput for the entire run used in reporting
the results. During each test, the system has zero idle time.
The system is a 133 MHz Alpha with 128 Meg of RAM. I have attempted to
have minimal tunable parameter changes from whatever the defaults were on
the two versions, and have attempted to have the same changes made on both
versions. The tunable changes are: sem-mni=32; msg-mni=1024;
max-proc-per-user=8000; maxusers=1024; sominconn=1024;
name-cache-hash-size=1024; vm-mapentries=16384; vm-ubcseqpercent=20; and
vm-vpagemax=65536.
I had not expected the select(2) version use so much system cpu time at
higher numbers of sockets, but (thinking about it) it does seem
reasonable. I was surprised that in moving from 3.2G to 4.0D, the
select(2) version showed an improvement in performance. At the 1024 socket
level, we went from 83 to 131 transactions per second (TPS). In fact, in
the new version, the select(2) approach has better TPS numbers than the
thread approach until a crossover at approximately 32 sockets, above which
the thread approach is still superior. In the 3.2G tests, there was no
crossover, with select(2) always being inferior to the thread approach, by
increasingly large margins as the number of sockets increased.
The thread approach shows a marked reduction in throughput under 4.0D vs.
the levels were were seeing under 3.2G. At the 1024 socket level, we went
from 1191 to 640 TPS. Using AF_LOCAL sockets, the performance went from
2446 to 857 TPS.
We are quite surprised and disappointed by the dramatic reduction in
performance we are seeing with 4.0D vs. 3.2G. We are curious as to what
the cause is, and whether there are any tunable parameter changes that
might be of help in restoring the previous (higher) performance levels.
If the answer is that the 3.2G implementation of threads and/or sockets
was very buggy and that 4.0D does it properly (though at a price), I can
understand that. As my C.S. professor (Dershem) told me many years ago,
"Any fool can write a fast sort program, if it doesn't have to put them in
the right order." So, I'd rather have correct than fast. If it's something
else, I'd like to know that, too, particularly if there is a known problem
with a fix available or soon to be available.
Thank you very much!
-----BEGIN PGP SIGNATURE-----
Version: PGP for Personal Privacy 5.5.3
Comment: My Keys: 0x571B55BD and 0x628ECED, available from keyservers
iQEVAwUBNYk20+ukCaFXG1W9AQEB9wf/UCXxAW/VtLymCXEtHK3uBmbSGggF5rbA
0S7RaKl3Wfr9CGiRwagp6aKz6oH2vB9nIs/tSCYkDNLy08eFZj9J7W3Zi6MjBm0A
Ie6Vzat12obRUDUqnAKo47qzBKsvt69l//2dNqsjwRl5BxPphK86SbOf4rYuSv+I
TN/dcc2CauogD8g8XSKYa9XES7+xII2iRRKi3mEDqxjEj3XR0EYKYteM29Kv2kej
mYG7OTnbEg18EQmpTBxEVYuW+1qHn/3q63fq9npVe8zedaYXven6oe1/vchy5GKC
ZkaxppnEFbvcp8IHDkDKFuOqubRWYUVFDeHaF0M3sLH2V+sSXg6KNw==
=vWOv
-----END PGP SIGNATURE-----
--
Ron.
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: 3.2G to 4.0D Benchmark Comparison
1998-06-18 4:00 3.2G to 4.0D Benchmark Comparison Ron Heiby
1998-06-19 4:00 ` Phil Hodges
@ 1998-06-19 4:00 ` Jeff Denham
1998-06-22 4:00 ` Ron Heiby
1 sibling, 1 reply; 6+ messages in thread
From: Jeff Denham @ 1998-06-19 4:00 UTC (permalink / raw)
Just as an experiement, try using System Contention Scope
threads, which area first supported in V4.0D.
Use
pthread_attr_t attr;
pthread_attr_init(&attr);
pthread_attr_setscope(&attr, PTHREAD_SCOPE_SYSTEM);
pthread_create(&tid, &attr, start, param);
Major performance improvements were made for
select() in V4.0, especially in V4.0D. You're
also running on a *completely* new pthreads
package, whose default behavior is to use
process scope threads. If you're mostly blocking
in the kernel for I/O, then system-scope threads
may help you out in avoiding some user-scheduling
overhead.
There are some fairly detailed discussions of 2-level
schedulers, esp the Digital UNIX one, over
in comp.programming.threads. Check it out with
DejaNews...
Ron Heiby wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
>
> Hi!
>
> While my firm was running Digital UNIX 3.2G, I ran several benchmark
> programs to attempt to determine a number of transactions per second that
> might be made through my system, and (more important) the relative speed
> of performing certain operations in different ways.
>
> The basic test is to have a client program and a server program that pass
> blocks of data back and forth to each other. In each case, the server
> establishes a socket connection on which to listen and the client
> establishes N connections to the server. Each connection has its own
> socket. The client picks a connection at random and sends 1000 bytes on
> it. The server receives these 1000 bytes and sends them back on the same
> socket on which they were received. When the client receives the 1000
> bytes back from the server, it repeats the process. Every second, the
> client displays statistical information, basically the number of
> transactions (round trips) it was able to accomplish in the last second,
> plus total and moving averages.
>
> There are different versions of the server. One version uses a single
> process and a single thread in that process, handling all N socket
> connections using select(2). Another creates a thread for each socket, and
> each thread does a blocking read on its socket, waiting for something to
> do. Another version of that threaded server (and modified client) use
> AF_LOCAL (AF_UNIX) sockets, instead of AF_INET sockets. In each test, both
> client and server are on the same machine.
>
> Each test is run for at least ten minutes with each of various numbers of
> socket connections (1, 2, 4, 8, 16, 32, 64, 128, 256, 512, 1024, 2000).
> (Why 2000, rather than 2048, you ask? Well, the thread approach runs out
> of system memory on my 128 Meg machine before I reach 2048 under 3.2G.
> Under 4.0D, I run out of memory a bit sooner.) The tests are run when the
> system is otherwise (basically) idle. The tests are run for at least ten
> minutes, with the average throughput for the entire run used in reporting
> the results. During each test, the system has zero idle time.
>
> The system is a 133 MHz Alpha with 128 Meg of RAM. I have attempted to
> have minimal tunable parameter changes from whatever the defaults were on
> the two versions, and have attempted to have the same changes made on both
> versions. The tunable changes are: sem-mni=32; msg-mni=1024;
> max-proc-per-user=8000; maxusers=1024; sominconn=1024;
> name-cache-hash-size=1024; vm-mapentries=16384; vm-ubcseqpercent=20; and
> vm-vpagemax=65536.
>
> I had not expected the select(2) version use so much system cpu time at
> higher numbers of sockets, but (thinking about it) it does seem
> reasonable. I was surprised that in moving from 3.2G to 4.0D, the
> select(2) version showed an improvement in performance. At the 1024 socket
> level, we went from 83 to 131 transactions per second (TPS). In fact, in
> the new version, the select(2) approach has better TPS numbers than the
> thread approach until a crossover at approximately 32 sockets, above which
> the thread approach is still superior. In the 3.2G tests, there was no
> crossover, with select(2) always being inferior to the thread approach, by
> increasingly large margins as the number of sockets increased.
>
> The thread approach shows a marked reduction in throughput under 4.0D vs.
> the levels were were seeing under 3.2G. At the 1024 socket level, we went
> from 1191 to 640 TPS. Using AF_LOCAL sockets, the performance went from
> 2446 to 857 TPS.
>
> We are quite surprised and disappointed by the dramatic reduction in
> performance we are seeing with 4.0D vs. 3.2G. We are curious as to what
> the cause is, and whether there are any tunable parameter changes that
> might be of help in restoring the previous (higher) performance levels.
>
> If the answer is that the 3.2G implementation of threads and/or sockets
> was very buggy and that 4.0D does it properly (though at a price), I can
> understand that. As my C.S. professor (Dershem) told me many years ago,
> "Any fool can write a fast sort program, if it doesn't have to put them in
> the right order." So, I'd rather have correct than fast. If it's something
> else, I'd like to know that, too, particularly if there is a known problem
> with a fix available or soon to be available.
>
> Thank you very much!
>
> -----BEGIN PGP SIGNATURE-----
> Version: PGP for Personal Privacy 5.5.3
> Comment: My Keys: 0x571B55BD and 0x628ECED, available from keyservers
>
> iQEVAwUBNYk20+ukCaFXG1W9AQEB9wf/UCXxAW/VtLymCXEtHK3uBmbSGggF5rbA
> 0S7RaKl3Wfr9CGiRwagp6aKz6oH2vB9nIs/tSCYkDNLy08eFZj9J7W3Zi6MjBm0A
> Ie6Vzat12obRUDUqnAKo47qzBKsvt69l//2dNqsjwRl5BxPphK86SbOf4rYuSv+I
> TN/dcc2CauogD8g8XSKYa9XES7+xII2iRRKi3mEDqxjEj3XR0EYKYteM29Kv2kej
> mYG7OTnbEg18EQmpTBxEVYuW+1qHn/3q63fq9npVe8zedaYXven6oe1/vchy5GKC
> ZkaxppnEFbvcp8IHDkDKFuOqubRWYUVFDeHaF0M3sLH2V+sSXg6KNw==
> =vWOv
> -----END PGP SIGNATURE-----
>
> --
> Ron.
--
__________________________________________________
Jeff Denham (jdenham@brighttiger.com)
Bright Tiger Technologies
SmartCluster� Software for Distributed Web Servers
http://www.brighttiger.com
125 Nagog Park
Acton, MA 01720
Phone: (978) 263-5455 x177
Fax: (978) 263-5547
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: 3.2G to 4.0D Benchmark Comparison
1998-06-18 4:00 3.2G to 4.0D Benchmark Comparison Ron Heiby
@ 1998-06-19 4:00 ` Phil Hodges
1998-06-19 4:00 ` Ron Heiby
1998-06-19 4:00 ` Jeff Denham
1 sibling, 1 reply; 6+ messages in thread
From: Phil Hodges @ 1998-06-19 4:00 UTC (permalink / raw)
I wonder if using poll(2) instead of select(2) would make a
significant difference?
--
------------------------------------------------------------
The above opinions and information are my own, and not
necessarily those of Digital Equipment Corporation.
------------------------------------------------------------
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: 3.2G to 4.0D Benchmark Comparison
1998-06-19 4:00 ` Phil Hodges
@ 1998-06-19 4:00 ` Ron Heiby
0 siblings, 0 replies; 6+ messages in thread
From: Ron Heiby @ 1998-06-19 4:00 UTC (permalink / raw)
-----BEGIN PGP SIGNED MESSAGE-----
Phil Hodges <hodges@decnet.enet.dec.com> wrote:
>I wonder if using poll(2) instead of select(2) would make a
>significant difference?
Under 3.2G, poll(2) was slightly slower in my tests, until we got upwards
of 32 socket connections. From there out, it was almost the same level of
performance as select(2). I have not repeated all of the poll(2) version
testing under 4.0D, but a "spot check" of the 1024 socket level shows a
throughput very close to the new (slightly faster) socket(2) throughput.
Even with the much slower thread throughput I'm seeing, the thread
implementation is still about an order of magnitude better than the
socket(2) or poll(2) implementation.
I suspect that in my test, with a large number of consecutively numbered
socket descriptors, one would naturally not see much difference between
select(2) and poll(2). I have not done the test, but I would expect that
checking fds 0, 1, 2, 1022, and 1023 would be faster with poll(2) than
with select(2), as the latter needs to look at each of the bits being
passed, to see if it needs to check that fd.
-----BEGIN PGP SIGNATURE-----
Version: PGP for Personal Privacy 5.5.3
Comment: My Keys: 0x571B55BD and 0x628ECED, available from keyservers
iQEVAwUBNYqypuukCaFXG1W9AQGNTQf/Z/ubiNEom9/rzAML2RFdpdXAw3psSzXj
rJ+xyme72ppXSzRWXZu3y7IfWBhyXG94x+5pf8c0SnR1cgVUGF23rbTIR5s7+Bxo
w0lU0L+HPnl7lzJApzdTJC6E7mvbXJSK3NPjNFyKhDcxco8y9NbGa8hX1RqWeLrO
QvU3Yv0J264PJhTxrklFhKq6XjwjAuiIB2soMc8jlAiHRE/Dx5HL5SUhReBu0n6l
WcZtAF+ULpia5v03o5iWMMDjmSU2Ki353xDoSDoj42EMvfTWhbLWLqtrr8yJmw5L
TU7sSIfbkH0oBN5EoDFGBMarVKbK5PEnTjbbWB8fhdcwnwbfq5uAPw==
=Cgei
-----END PGP SIGNATURE-----
--
Ron.
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: 3.2G to 4.0D Benchmark Comparison
1998-06-19 4:00 ` Jeff Denham
@ 1998-06-22 4:00 ` Ron Heiby
1998-06-23 4:00 ` Jeff Denham
0 siblings, 1 reply; 6+ messages in thread
From: Ron Heiby @ 1998-06-22 4:00 UTC (permalink / raw)
-----BEGIN PGP SIGNED MESSAGE-----
Jeff Denham <jdenham@brighttiger.com> wrote:
>Just as an experiement, try using System Contention Scope
>threads, which area first supported in V4.0D.
Jeff, Thanks much for the great tip! It looks like you were right on
target. Although I haven't yet finished running all of the flavors and
levels of benchmark, the ones I have run have been very close to the
previous performance levels.
Once you pointed out that this change had happened, I downloaded some of
the 4.0D documentation and found the sections that discuss this change.
Reading the manual, one would never suspect that this would be the cause
of the performance drop I'm seeing. Do you know of any better description
of the pros and cons of one scope vs. the other? I've got the
Norton/Dipasquale "Threadtime" book and the pthreads book from O'Reilley,
and will be diving into them, looking for such a discussion. If you know
of anywhere else, I'd appreciate a pointer.
Thanks again!
-----BEGIN PGP SIGNATURE-----
Version: PGP for Personal Privacy 5.5.3
Comment: My Keys: 0x571B55BD and 0x628ECED, available from keyservers
iQEVAwUBNY6BcOukCaFXG1W9AQEJ8gf5ATvyOusKEvzHN+QAWIaGir+5qwd1jxu6
4vRIitBirjK3+TfZlFpWOxbueqxJ5tMRN+YD9xmFX/pxAA1u3Z2Gd0JBdPwSRdrp
LPBKHJk4PMzV3V5IgYYBitz4ZH+O/DCOJfuY6+/ZyCCsbItlc967PbRbclbUPM7I
JaIsI4akiujsFm2arLbktIvAZYoqQUkMkDe309doVt02QUBA/uRRZr2YAavzl6Bd
2n0hPmsRF6oWn9WlN1xGXsEisMSfu/Uc5NH7ixK016yXOQt3bq+xZlZKUahc+JDu
lTAu1WH06M9KC93mR3osjW9NR9DxtblinIztOF83g87HizdpjR3JAg==
=e0kd
-----END PGP SIGNATURE-----
--
Ron.
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: 3.2G to 4.0D Benchmark Comparison
1998-06-22 4:00 ` Ron Heiby
@ 1998-06-23 4:00 ` Jeff Denham
0 siblings, 0 replies; 6+ messages in thread
From: Jeff Denham @ 1998-06-23 4:00 UTC (permalink / raw)
Ron Heiby wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
>
> Jeff Denham <jdenham@brighttiger.com> wrote:
> >Just as an experiement, try using System Contention Scope
> >threads, which area first supported in V4.0D.
>
> Jeff, Thanks much for the great tip! It looks like you were right on
> target. Although I haven't yet finished running all of the flavors and
> levels of benchmark, the ones I have run have been very close to the
> previous performance levels.
>
> Once you pointed out that this change had happened, I downloaded some of
> the 4.0D documentation and found the sections that discuss this change.
> Reading the manual, one would never suspect that this would be the cause
> of the performance drop I'm seeing. Do you know of any better description
> of the pros and cons of one scope vs. the other? I've got the
> Norton/Dipasquale "Threadtime" book and the pthreads book from O'Reilley,
> and will be diving into them, looking for such a discussion. If you know
> of anywhere else, I'd appreciate a pointer.
Personally, I think Dave Butenhof's Addison-Wesley book,
_Programming_with_POSIX_Threads_ gives you the
most bang for your buck. There's a good discussion
of contention scope in there.
The best discussions of scope has been over the last few months
in comp.programming.threads -- check back in time with
dejanews.com.
Digital threading people contend that PCS threads are the
"best" and should be used exclusivley, except for occasional exceptions,
usually involving I/O. There are ongoing efforts
to reduce the overhead of PCS threads and narrow the
performance gap for those special cases (like yours).
The next major release of Compaq's Digital UNIX (tm)
(probably called V5.0) should look a little better at least.
A rule of thumb is of thumb here is to start out with
PCS threads (as you did) and only fall back to SCS
threads when performance doesn't live up to expectations.
BTW, there's no way to make you "main" thread SCS,
so you'll always have at least on PCS thread in the mix
In the Solaris world, where I've been hanging out the last
6 months or so, SCS threads are used almost exclusively.
This came about because of implementation deficiencies in
the Solaris 2-level scheduler. Things have gotten a little
better in 2.6, but everyone still uses SCS threads. I know
I do.
__________________________________________________
Jeff Denham (jdenham@brighttiger.com)
Bright Tiger Technologies
SmartCluster� Software for Distributed Web Servers
http://www.brighttiger.com
125 Nagog Park
Acton, MA 01720
Phone: (978) 263-5455 x177
Fax: (978) 263-5547
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~1998-06-23 4:00 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
1998-06-18 4:00 3.2G to 4.0D Benchmark Comparison Ron Heiby
1998-06-19 4:00 ` Phil Hodges
1998-06-19 4:00 ` Ron Heiby
1998-06-19 4:00 ` Jeff Denham
1998-06-22 4:00 ` Ron Heiby
1998-06-23 4:00 ` Jeff Denham
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox