Usenet comp.sys.dec (1990-2013)
 help / color / mirror / Atom feed
* poor SSD (EZ51R) performance
@ 1994-10-25  8:15 Mr Mike James Lijewski
  1994-10-26  4:12 ` Hein RMS van den Heuvel
  0 siblings, 1 reply; 4+ messages in thread
From: Mr Mike James Lijewski @ 1994-10-25  8:15 UTC (permalink / raw)



The following script illustrates an attempt to understand the
performance (or lack thereof) of an EZ51R Solid State Disk (SSD).
According to the DEC documentation on the disk the maximum throughput
is 800 I/Os per second.  The best I get in my tests is about 250 I/Os
per second from one process doing random writes.  I consider this too
far off the expected maximum to be acceptable.  This was run on a
four processor DEC Model 2100/500 under OSF/1 V3.0.  Would someone
with access to an SSD please repeat my experiment.  Either something
is seriously wrong with my setup or I've been sold a bill of goods.

Script started on Mon Oct 24 08:51:11 1994

<bsr02>:/tmp/stuff:$ uname -a

OSF1 bsr02 V3.0 358 alpha

<bsr02>:/tmp/stuff:$ disklabel -r /dev/rrz9c

# /dev/rrz9c:
type: SCSI
disk: MIKE
label: 
flags:
bytes/sector: 512
sectors/track: 33
tracks/cylinder: 9
sectors/cylinder: 297
cylinders: 776
sectors/unit: 208800
rpm: 3600
interleave: 1
trackskew: 0
cylinderskew: 0
headswitch: 0		# milliseconds
track-to-track seek: 0	# milliseconds
drivedata: 0 

8 partitions:
#        size   offset    fstype   [fsize bsize   cpg]
  a:    40960        0    unused     1024  8192       	# (Cyl.    0 - 137*)
  b:        0        0    unused        0     0       	# (Cyl.    0 - -1)
  c:   208800        0    unused     1024  8192       	# (Cyl.    0 - 703*)
  d:        0        0    unused        0     0       	# (Cyl.    0 - -1)
  e:        0        0    unused        0     0       	# (Cyl.    0 - -1)
  f:        0        0    unused        0     0       	# (Cyl.    0 - -1)
  g:   167840    40960    unused     1024  8192       	# (Cyl.  137*- 703*)
  h:        0        0    unused        0     0       	# (Cyl.    0 - -1)

<bsr02>:/tmp/stuff:$ cat traw.c

#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <fcntl.h>
#include <sys/stat.h>
#include <sys/types.h>
#include <sys/time.h>

#define BLOCKSIZE 1024              /* Maximum size of each write. */
#define FILESIZE  (1000*BLOCKSIZE) /* Size of file being randomly updated. */

static double elapsed_seconds (struct timeval* tp)
{
    static struct timeval otp;
    static struct timezone tzp;
    otp = *tp;
    if (gettimeofday(tp, &tzp) < 0)
        perror("gettimeofday"), exit(1);
    return (tp->tv_sec - otp.tv_sec) + (tp->tv_usec - otp.tv_usec)/1000000.0;
}

int main ()
{
    char* fp = 0;
    int i = 0, fd = 0;
    const int Count = 5000;
    const char* file = "/dev/rrz9g";
    struct timeval timer   = { 0, 0 };
    unsigned char buf[BLOCKSIZE];

    srandom(13);  /* Use the same random seed for repeatability. */

    if ((fd = open(file, O_RDWR|O_CREAT|O_TRUNC, 0666)) < 0)
        perror("open"), exit(1);

    memset(buf, 'x', BLOCKSIZE);  /* Initialize buf to known value. */

    (void) fprintf(stderr, "Building %d byte file in memory ...\n", FILESIZE);

    if ((fp = (char*) malloc(FILESIZE)) == 0)
        fprintf(stderr, "malloc() failed, bye\n"), exit(1);

    memset(fp, '#', FILESIZE);    /* Touch every byte in buffer. */

    (void) fprintf(stderr, "Writing %d bytes to %s ...\n", FILESIZE, file);

    (void) elapsed_seconds(&timer);
    if (!(write(fd, fp, FILESIZE) == FILESIZE))
        perror("write"), exit(1);
    if (fsync(fd) < 0)
        perror("fsync"),exit(1);
    (void) fprintf(stderr,
                   "Wrote %d bytes to %s in %g seconds.\n",
                   FILESIZE, file, elapsed_seconds(&timer));
    free(fp);

    (void) fprintf(stderr, "Doing %d random writes to %s ...\n", Count, file);

    (void) elapsed_seconds(&timer);
    for (i = 0; i < Count; i++)
    {
        int size = random() % (BLOCKSIZE-1) + 1;
        if (lseek(fd, random()%(FILESIZE-BLOCKSIZE-1), SEEK_SET) < 0)
            perror("lseek"), exit(1);
        if (!(write(fd, buf, size) == size))
            perror("write"), exit(1);
        if (fsync(fd) < 0)
            perror("fsync"), exit(1);
    }
    (void) fprintf(stderr,
                   "Average write time per block was %g seconds.\n",
                   elapsed_seconds(&timer)/Count);
    return 0;
}

<bsr02>:/tmp/stuff:$ cc -O -o traw traw.c

<bsr02>:/tmp/stuff:$ ./traw

Building 1024000 byte file in memory ...
Writing 1024000 bytes to /dev/rrz9g ...
Wrote 1024000 bytes to /dev/rrz9g in 0.574864 seconds.
Doing 5000 random writes to /dev/rrz9g ...
Average write time per block was 0.00396994 seconds.

<bsr02>:/tmp/stuff:$ exit

script done on Mon Oct 24 08:52:32 1994


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~1994-10-27 13:16 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
1994-10-25  8:15 poor SSD (EZ51R) performance Mr Mike James Lijewski
1994-10-26  4:12 ` Hein RMS van den Heuvel
1994-10-27  0:26   ` Mr Mike James Lijewski
1994-10-27 13:16     ` Hein RMS van den Heuvel

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox