I have two machines
are identical with one exception that I believed was identical when I first wrote this article:
- First has 40 GB RAM (IBM 3850 M2 / x3950 M2, PCI-E)
- Second has 64 GB RAM (IBM x3950, PCI-X)
In all other aspects they are identical:
- OS Red Hat Enterprise Linux 4.7
- linux kernel 2.6.9-89 x86_64
- perl 5.8.9
- identical processor, disks, etc.
Some say
less is more, but it is a real surprise to see that
the machine with 40 GB RAM seems to be
roughly twice as fast as the
machine with 64 GB RAM. The behavior is consistent, and as illustrated by this little benchmark
(which is CPU intensive, but requires little memory):
use warnings;
use strict;
use JSON::XS;
use Benchmark qw(cmpthese);
my $coder = JSON::XS->new->ascii->pretty->allow_nonref;
my $hashref = { one => 1, two => 2, three => 3, four => { nested => 'b
+ird' } };
my $arrayref = [ 'one', 'two', 'three', 'four', 'five', 'six' ];
# cmpthese can be used both ways as well
cmpthese(
-1,
{
'enc+dec hashref ' =>
sub { $coder->decode( $coder->encode( $hashref ) ) },
'enc+dec arrayref ' =>
sub { $coder->decode( $coder->encode( $arrayref ) ) },
}
);
__END__
[me@first ~]$ ./perl-json-test.pl
Rate enc+dec hashref enc+dec arrayref
enc+dec hashref 344063/s -- -22%
enc+dec arrayref 438597/s 27% --
[me@second ~]$ ./perl-json-test.pl
Rate enc+dec hashref enc+dec arrayref
enc+dec hashref 153121/s -- -24%
enc+dec arrayref 200972/s 31% --
A collegues commented that Red Hat Linux has a terrible track record
in High Performance Computing and that the memory management is not
well suited for two digit gigabytes of RAM. He suggests to use another Linux distribution (such as SuSE), but client policy prevents that.
Do any of the honorable monks have made similar observations or even reasonable explanation to why the machine with the most memory is the slower one?
Update 1: Actually, I have 4 machines of which 2 are pairwise identical. Each machine behaves identically as its twin.
Update 2 : Thanks for helpful replies. As I have remote access only to the machines in question, I can't experiment as broadly as I otherwise would have, but I'll surely update this thread once I get some results. I have asked the services provider to reduce physical memory down to 16 Gb.
Update 3 :
It turns the machines were not identical after all (see top), and that reducing the memory down to 16 Gb did not significantly change the benchmarks. Whether or not the PCI bus type can account for the huge difference in overall performance is unknown.
--
No matter how great and destructive your problems may seem now, remember, you've probably only seen the tip of them. [1]
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
| |
For: |
|
Use: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.