summaryrefslogtreecommitdiffstats
path: root/extras/benchmarking/README
blob: 92c829606695bd9d8b8fed83f0a245e7b9b2da10 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32

--------------
Parallel DD performance:

* Copy the local-script.sh in ${mountpoint}/benchmark/ directory
* Edit it so the blocksize and count are as per the requirements

* Edit the launch-script.sh script to make sure paths, mountpoints etc are 
  alright.

* run 'lauch-script.sh'

* after the run, you can get the aggregated result by adding all the 3rd entry 
  in output.$(hostname) entries in 'output/' directory.

--------------

iozone:

bash# iozone - +m iozone_cluster.config - t 62 - r ${block_size} - s \
      ${file_size} - +n - i 0 - i 1

--------------
rdd: random dd - tool to do a sequence of random block-sized continuous 
     read writes starting at a random offset

gcc -pthread rdd.c -o rdd

--------------
glfs-bm: tool to benchmark small file performance

gcc glfs-bm.c -lglusterfsclient -o glfs-bm
ad'>diff --git a/api/src/glfs-fops.c b/api/src/glfs-fops.c
index fe230e6a9..0bea82a04 100644
--- a/api/src/glfs-fops.c
+++ b/api/src/glfs-fops.c
@@ -26,6 +26,41 @@
} \
} while (0)
+
+static int
+glfs_loc_link (loc_t *loc, struct iatt *iatt)
+{
+ int ret = -1;
+ inode_t *linked_inode = NULL;
+
+ if (!loc->inode) {
+ errno = EINVAL;
+ return -1;
+ }
+
+ linked_inode = inode_link (loc->inode, loc->parent, loc->name, iatt);
+ if (linked_inode) {
+ inode_lookup (linked_inode);
+ inode_unref (linked_inode);
+ ret = 0;
+ } else {
+ ret = -1;
+ errno = ENOMEM;
+ }
+
+ return ret;
+}
+
+
+static int
+glfs_loc_unlink (loc_t *loc)
+{
+ inode_unlink (loc->inode, loc->parent, loc->name);
+
+ return 0;
+}
+
+
struct glfs_fd *
glfs_open (struct glfs *fs, const char *path, int flags)
{
@@ -302,9 +337,13 @@ retry:
goto out;
}
- ret = syncop_create (subvol, &loc, flags, mode, glfd->fd, xattr_req);
+ ret = syncop_create (subvol, &loc, flags, mode, glfd->fd,
+ xattr_req, &iatt);
ESTALE_RETRY (ret, errno, reval, &loc, retry);
+
+ if (ret == 0)
+ ret = glfs_loc_link (&loc, &iatt);
out:
loc_wipe (&loc);
@@ -998,9 +1037,12 @@ retry:
goto out;
}
- ret = syncop_symlink (subvol, &loc, data, xattr_req);
+ ret = syncop_symlink (subvol, &loc, data, xattr_req, &iatt);
ESTALE_RETRY (ret, errno, reval, &loc, retry);
+
+ if (ret == 0)
+ ret = glfs_loc_link (&loc, &iatt);
out:
loc_wipe (&loc);
@@ -1115,9 +1157,12 @@ retry:
goto out;
}
- ret = syncop_mknod (subvol, &loc, mode, dev, xattr_req);
+ ret = syncop_mknod (subvol, &loc, mode, dev, xattr_req, &iatt);
ESTALE_RETRY (ret, errno, reval, &loc, retry);
+
+ if (ret == 0)
+ ret = glfs_loc_link (&loc, &iatt);
out:
loc_wipe (&loc);
@@ -1191,9 +1236,12 @@ retry:
goto out;
}
- ret = syncop_mkdir (subvol, &loc, mode, xattr_req);
+ ret = syncop_mkdir (subvol, &loc, mode, xattr_req, &iatt);
ESTALE_RETRY (ret, errno, reval, &loc, retry);
+
+ if (ret == 0)
+ ret = glfs_loc_link (&loc, &iatt);
out:
loc_wipe (&loc);
@@ -1238,6 +1286,9 @@ retry:
ret = syncop_unlink (subvol, &loc);
ESTALE_RETRY (ret, errno, reval, &loc, retry);
+
+ if (ret == 0)
+ ret = glfs_loc_unlink (&loc);
out:
loc_wipe (&loc);
@@ -1279,6 +1330,9 @@ retry:
ret = syncop_rmdir (subvol, &loc);
ESTALE_RETRY (ret, errno, reval, &loc, retry);
+
+ if (ret == 0)
+ ret = glfs_loc_unlink (&loc);
out:
loc_wipe (&loc);
@@ -1341,6 +1395,11 @@ retrynew:
goto retry;
}
}
+
+ if (ret == 0)
+ inode_rename (oldloc.parent->table, oldloc.parent, oldloc.name,
+ newloc.parent, newloc.name, oldloc.inode,
+ &oldiatt);