[omniORB-dev] 4.0.5 omniNames performance patch

Jonathan Biggar jon at levanta.com
Wed Aug 3 15:06:12 BST 2005


We discovered that omniNames caused *very* bad performance on a hardware 
RAID5 array if the omniNames error log was stored on the array.  This 
was because it was opening its error log using O_SYNC and unbuffered, 
which tells the kernel to  synchronously flush to the disk *each* 
character written to the log.

I've attached a patch to 4.0.5 that fixes this problem.  (I don't see 
any safety reason why the omniNames error log needs to use O_SYNC or be 
unbuffered anyway...)

-- 
Jon Biggar
Levanta
jon at levanta.com
-------------- next part --------------
--- omniORB-4.0.5/src/appl/omniNames/omniNames.cc.orig	2003-05-09 06:32:59.000000000 -0700
+++ omniORB-4.0.5/src/appl/omniNames/omniNames.cc	2005-07-01 14:16:53.000000000 -0700
@@ -150,12 +150,13 @@
       int fd = _open(argv[2], O_WRONLY | O_CREAT | O_TRUNC, _S_IWRITE);
       if (fd < 0 || _dup2(fd,2)) {
 #else
-      int fd = open(argv[2], O_WRONLY | O_CREAT | O_TRUNC | O_SYNC, 0666);
+      int fd = open(argv[2], O_WRONLY | O_CREAT | O_TRUNC, 0666);
       if (fd < 0 || dup2(fd,2) < 0) {
 #endif
 	cerr << "Cannot open error log file: " << argv[2] << endl;
 	usage();
       }
+      setlinebuf(stderr);
       removeArgs(argc, argv, 1, 2);
     }
     else if ((strncmp(argv[1], "-ORB", 4) != 0)) {


More information about the omniORB-dev mailing list