[omniORB-dev] 4.0.5 omniNames performance patch
Alex Tingle
alex.tingle at bronermetals.com
Mon Aug 15 12:20:38 BST 2005
Jon,
The omniNames log is NOT an error log. It's a persistency log. Every
time the state of the omniNames database changes, the change is
appended to the log. Obviously it's written synchronously so that the
change is flushed to disk rather than stored in RAM where it might be
destroyed by a system failure.
I would expect that the log would never be changed when you are reading
data from omniNames, so in normal use there would be no performance
penalty.
What are you doing to see a performance problem?
-Alex
--
Dammit Jim, I'm a programmer... not a mind reader!
On 3 Aug 2005, at 22:06, Jonathan Biggar wrote:
> 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
>
> --- 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)) {
> _______________________________________________
> omniORB-dev mailing list
> omniORB-dev at omniorb-support.com
> http://www.omniorb-support.com/mailman/listinfo/omniorb-dev
More information about the omniORB-dev
mailing list