PDA

View Full Version : Benchmarks for Linux



Skillz
05-29-2007, 06:12 PM
As the title states, what are; if there are any. Some good benchmarking programs for the Linux operating system.

Basically linux versions of superpi, 3dmark, pcmark, orthros, prime95 and the like.

[XC] Teroedni
05-30-2007, 12:21 AM
I recomend Hardinfo

Contains both information about your computers

cpu,sensor,Display info etc

and also got some Benchmark
Cpu Zlib
Cpu Fibbonacci
Cpu Md5
Cpu Sha1
Cpu Blowfish
Fpu Raytracing


And you can sync the benchmark part. Meaning that the list of other computers to compare to gets bigger:)




http://hardinfo.berlios.de/web/HomePage


This is how it looks:)

Skillz
05-30-2007, 02:12 PM
Oh nice, looks good.

Downloading it as I type, question though. Does it do any 3D benches or is this just for the CPU?

stevecs
05-30-2007, 05:01 PM
Depending on what you are trying to test for performance there are several utilities that I would use Hardinfo is a good basic tool but has some problems on other hardware (ie, SGI systems, USS on mainframes (or even linux on mainframes). Don't know if you are interested in just graphics/end user testing or something more akin to server testing. If server then you have:

bonnie++ for disk I/O. Generally I use something like:
Compiled defaults ; ./bonnie++ -d <Scratch Directory> -s 16g -m <Machine Name> -n16:1048576:0:32

Memory size set to 4x the total memory on system (ram + raid controller + external subsystem if exists).


For processor tests an OLD test (still has some value but you have to hack it, good to plot performance when comparing against older systems) is UnixBench . Generally for newer tests if I know what the application is I will find/pick something that will do the same type of function and run it for a benchmark. (ie, hash tests, encryption tests (for pki or whatever).

For network testing a cool tool is Iperf that I was just turned on to around here in the network forum works great. ;)

For fast memory bandwidth testing (this is a quickie good for checking parallel processing bandwidth (ie, systems that may have many cpu's). (included below since it's small)

---

/*
* Try to measure and report memcpy bandwidth of parallel processes.
* Synchronization is coarse, to be as portable as possible,
* at the expense of some timing accuracy.
*/

#include <stddef.h>
#include <stdlib.h>
#include <unistd.h>
#include <stdio.h>
#include <string.h>
#include <float.h>
#include <sys/time.h>
#include <errno.h>

char usage[] = "Usage: %s [-v] [-c chunk_size] [-n nchunks] [-p nprocesses] "
"[-a alignment_adjust]\n";
int chunk_size = 4*1024*1024, nchunks = 10, nprocesses = 1, aadjust = 1024;
int verbose = 0;

#ifndef do_memcpy
#define do_memcpy(d,s,c) memcpy(d,s,c)
#endif

int
main (int argc, char **argv)
{
int c, n;
char *src, *dst;
int pipe_barrier[2];
int pipe_results[2];
char junk;
struct timeval tv_start, tv_end;
double *all_times, *next_time;
double min_start = DBL_MAX, max_start = DBL_MIN,
min_end = DBL_MAX, max_end = DBL_MIN;

while ((c = getopt (argc, argv, "vc:n:p:a:")) != EOF)
switch (c) {
default: fprintf (stderr, usage, argv[0]); return 1;
case 'v': verbose = 1; break;
case 'c': chunk_size = atoi(optarg); break;
case 'n': nchunks = atoi(optarg); break;
case 'p': nprocesses = atoi(optarg); break;
case 'a': aadjust = atoi(optarg); break;
}
if (optind < argc) {
fprintf (stderr, usage, argv[0]);
return 1;
}
printf ("%s: chunk_size = %d, nchunks = %d, nprocesses = %d, "
"aadjust=%d\n",
argv[0], chunk_size, nchunks, nprocesses, aadjust);
fflush(stdout);
if (pipe (pipe_barrier) < 0) {
perror ("pipe pipe_barrier");
return 2;
}
if (pipe (pipe_results) < 0) {
perror ("pipe pipe_results");
return 2;
}
src = malloc (2 * chunk_size + aadjust);
if (src == NULL) {
fprintf (stderr, "%s: malloc(%d) failed for data\n",
argv[0], 2 * chunk_size + aadjust);
return 2;
}
dst = src + chunk_size + aadjust;
all_times = malloc (nprocesses * 2 * sizeof(double));
if (all_times == NULL) {
fprintf (stderr, "%s: malloc(%d) failed for all_times\n",
argv[0], nprocesses * 2 * sizeof(double));
return 2;
}
for (c = nprocesses; c > 1; c--) {
switch (fork()) {
case -1: perror ("fork"); return 2;
case 0: break; /* child: start waiting */
default: continue; /* parent: continue forking */
}
break; /* child */
}

memset (src, 0, chunk_size); /* initialize and break copy on write */
memset (dst, 0, chunk_size);

if (close (pipe_barrier[1]) < 0) {
perror ("close pipe_barrier[1]");
return 2;
}
/* this read will get EOF when all the processes have started */
if (read (pipe_barrier[0], &junk, 1) < 0) {
perror ("pipe read");
return 2;
}
if (gettimeofday (&tv_start, NULL) < 0) {
perror ("gettimeofday 0");
return 2;
}
/* this is the stuff being measured */
for (n = nchunks; n > 0; n--)
do_memcpy (dst, src, chunk_size);

if (gettimeofday (&tv_end, NULL) < 0) {
perror ("gettimeofday 1");
return 2;
}
all_times[0] = (double)tv_start.tv_sec + tv_start.tv_usec / 1000000.;
all_times[1] = (double)tv_end.tv_sec + tv_end.tv_usec / 1000000.;
if (verbose)
printf ("p%d: %d bytes copied in %f secs = %f MB/s\n",
c, chunk_size * nchunks, all_times[1] - all_times[0],
(double)(chunk_size * nchunks) /
(all_times[1] - all_times[0]) / (1024.*1024.));

if (c>1) { /* write time values back to parent */
errno = 0; /* should check return value instead XXX */
if (write (pipe_results[1], all_times, 2*sizeof(double)) !=
2*sizeof(double)) {
perror ("write pipe_results[1]");
return 2;
}
}
if (close (pipe_results[1]) < 0) {
perror ("close pipe_results[1]");
return 2;
}
if (c==1) { /* collect and summarize the results */
next_time = &all_times[2];
/* should be more careful about errors & overrun XXX */
while (read (pipe_results[0], next_time,
2 * sizeof(double)) == 2 * sizeof(double))
next_time += 2;
if (next_time != &all_times[2*nprocesses]) {
fprintf (stderr, "%s: next_time=%d is wrong\n",
argv[0], next_time - all_times);
return 2;
}
while (wait(NULL) >= 0)
continue; /* should check for errors XXX */
/*
* Use earliest start time and latest stop time.
* Also warn about non-overlap.
*/
for (n = 0; n < nprocesses; n++) {
if (min_start > all_times[n*2+0])
min_start = all_times[n*2+0];
if (max_start < all_times[n*2+0])
max_start = all_times[n*2+0];
if (min_end > all_times[n*2+1])
min_end = all_times[n*2+1];
if (max_end < all_times[n*2+1])
max_end = all_times[n*2+1];
}
printf ("%d*%d bytes copied in %f secs = %d*%f MB/s = %f MB/s",
nprocesses, chunk_size * nchunks, max_end - min_start,
nprocesses, ((double)chunk_size * nchunks) /
(max_end - min_start) / (1024.*1024.),
((double)nprocesses * chunk_size * nchunks) /
(max_end - min_start) / (1024.*1024.));
if (max_start >= min_end)
printf (" (some non-overlap occured)");
printf ("\n");
}
return 0;
}



Like everything though a good habit is to come up with a standard set of tests and record the results in a spreadsheet/database for future reference. Lets you plot for capacity planning issues over the years (I work for an out-sourcing company so I get a LOT of crap equipment that comes in to be tested/upgrade/migrated/whatever.

Probably not exactly what you were wanting :shrug: but just a data point.

Skillz
06-01-2007, 11:20 AM
Nice, I really want to attempt to get into gaming on Linux. So I'm trying to find a 3DBenchmark, similar to 3Dmark05 and the like.

stevecs
06-01-2007, 12:30 PM
I've never really had a need to test any graphics on a unix platform actually so never really looked. For linux/home use I've used Slackware/Mandriva(Mandrake)/and now Ubuntu. I've attempted to move some PC games over to it but nearly all the games that I have/try do not seem to work that well under linux or at least not as good as under windows the little 'annoyances' just keep getting in the way. (like certain fonts not loading so you can't see all the text, mouse/alpha channel not displayed properly for some games in wine/cedega) and then generally the microshaft strong-arm of having most of the games that I play written in DirectX.

If you do find a good 3dmark type tool for linux please post about it.