in reply to Re: SysV shared memory (Look-Alike) -- pure perl
in thread SysV shared memory (Look-Alike) -- pure perl
Thanks for the response! Some points:
That is how I'm hoping to use this technique. I have a pure-Perl database engine that is basically single user for writing and multi-user for reading within the same environment. It's very fast, but when any single DB within an environment goes past 10MM records the writes drop sharply. Up to about 10MM records the writes are about 3,000/second. Above 10MM records that drops to 1,000 writes/second or worse. But that's not the problem either. The problem is that when the 'writer' is taken longer, the multiple 'readers' performance degradates significantly. Reading sequentially ( 'ReadNext' or 'ReadPrev" ) within the same DB the 'readers' usually perform about 100K reads / second. Above 10MM the reads drop to 20-25K reads / second. This technique would be to allow the writer to indicate which tree leaf the writer is working within. If the reader needs a record from that leaf, they have to wait, but if not then they can proceed with any other leaf.
to benchmark message passing, one needs both a reader and a writer...
Agreed, but I was testing that the writers didn't clobber the shared memory. In production, I can 'flock' with 'LOCK_SH' for readers. Each tree leaf is independent of any other tree leaf, so maybe I'll be able to have multi-writers
I'm going to add the code in the main thread, but I'd appreciate any comments on what it is doing.
Regards...Ed
"Well done is better than well said." - Benjamin Franklin
|
|---|