[ic] CounterFile.pm and NFS

Dan Browning interchange-users@interchange.redhat.com
Wed May 8 19:21:07 2002


At 02:04 PM 5/8/2002 -0400, you wrote:
>IC 4.8.3, NFS Sessions, mysql 3.23.47, linux 2.4.19, LockType fcntl
>
>
>What is the solution for having the order.number file on a NFS mounted
>directory in a clustered environment? As I understand it this
>CounterFile.pm will be responsible for incrementing the order numbers
>but it does not work with NFS. I would really like the order number to
>go up by one for every new order regardless of the server that handled
>the final order.
>
>I noticed intermittent, very long delays when requesting pages. I saw:
>
>kir:~# strace -p 7428 (an interchange process)
>flock(10, LOCK_EX
>
>and assumed it had something to do with this CounterFile.pm.
>--
>Bill Carr

I have experienced some problems with CounterFile.pm on our cluster, but 
only under very high loads.  I agree with Kevin Walsh who has in the past 
commented that CounterFile.pm doesn't support fcntl locks.  Kevin proposed 
one solution:

"I think the File::CounterFile module should be moved into the Vend 
namespace (Vend::File::CounterFile) and Interchange-ised to use the 
Vend::Util module for locks and stuff like that, probably based upon the 
LockType config."

To which Mike Heins said,
"Yes, I think we need a general Vend::Counter module that allows the 
default type of counter to be set. So I vote that if work is to be done on 
this, we go all the way and allow several differnet counter methods."

order.number probably isn't your biggest write contention compared to 
sessions, but you could work around it if it were possible to use different 
prefixes (A-1000, B-1000, etc.) for each node in the cluster, and store it 
locally.  For the problem of sessions, you could switch to MySQL sessions 
instead of NFS, they have worked great for me.  That's all for now, good luck,

+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
| Dan Browning, Kavod Technologies <db@kavod.com>
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Magpie, n.:
         A bird whose theivish disposition suggested to someone that it
might be taught to talk.
                 -- Ambrose Bierce, "The Devil's Dictionary"