Re: In-memory caches and app server load-balancing

From: Venkatesh M.C. (mc.venkatesh_at_siemens.com)
Date: 09/27/03

  • Next message: wereHamster: "Re: File accessing"
    Date: Sat, 27 Sep 2003 19:30:14 +0530
    
    

    Kasper, maybe I didn't get what you said. Anyway, let me explain my
    situation a bit more.

    The locks are in-memory locks on each application server. The client is a
    stateless web server (actually it's a web server farm.)

    Here's an example: User1 wants to do the following, all in one hit to the
    server:
    1) Try to get a lock on object O1 for modifying. (The current API to do this
    takes a string as a parameter - it could be "O1" here) If some other user
    has already acquired a lock on O1, U1 must get back an error.
    2) If lock granted, then modify O1 and save it to the database. (we don't
    want to use database locks, that's why we have the locks here.)
    3) Unlock O1.

    Obtaining the lock in Step 1 above is accomplished by a LockManager
    component that holds a list of all the locks in memory. Until now that was
    fine because all calls hit this one server, but now there are calls going to
    different servers. I don't understand how your suggestion on using serial
    numbers can get the lock managers on the different server machines in synch
    with one another. Could you please elaborate..

    Also, the cache synchronisation should not bring down the performance.

    "Kasper Dupont" <kasperd@daimi.au.dk> wrote in message
    news:3F75921A.E474B2EB@daimi.au.dk...
    > "Venkatesh M.C." wrote:
    > >
    > > Hi,
    > >
    > > I have a program running on an application server that creates and works
    > > with the following.
    > >
    > > (a) in-memory caches of data from the database and
    > > (b) symbolic "locks" used to control concurrent user access to certain
    > > pieces of data.
    > >
    > > I have a requirement to have the program run on an application server
    farm.
    > > Any suggestions on how I can keep my caches in each of the server
    machines
    > > in synch with one another? The symbolic locks have be kept in synch
    across
    > > the servers without any delays.
    > >
    > > Any hints would be greatly appreciated.
    >
    > All locks are to be maintained by the server. When a client needs to lock
    > an object, it sends a request to the server and waits for a response. The
    > response contains a serial number, if equivalent to the cached serial
    > number on the client the cache can be used, otherwise the cache on the
    > client have to be discarded. The serial number from the server is then
    > cached by the client.
    >
    > When a read+write lock is unlocked, both client and server increases their
    > own serial number of the object. Any other cached instance of the object
    > will have a smaller serial number, and will thus be known to be invalid.
    >
    > Recursive structures with locks of different granularity gets more
    > complicated, but I believe you can use some of the same ideas.
    >
    > --
    > Kasper Dupont -- der bruger for meget tid paa usenet.
    > For sending spam use mailto:aaarep@daimi.au.dk
    > Their business was zero and it was shrinking.


  • Next message: wereHamster: "Re: File accessing"

    Relevant Pages

    • How to implement synchronous rpc between 2 processes on the same machine.
      ... i.e it internally maintains a pool of threads i.e the server(process ... So here is my design the i want you to kindly kindly review and give ... The client i.e p1 invokes the function, ... The server thread gets the signal, locks mutex M1 executes the called ...
      (comp.programming.threads)
    • How to implement synchronous rpc between processes on the same machine
      ... i.e it internally maintains a pool of threads i.e the server(process ... So here is my design the i want you to kindly kindly review and give ... The client i.e p1 invokes the function, ... The server thread gets the signal, locks mutex M1 executes the called ...
      (comp.unix.programmer)
    • Re: 2.6.2-rc2 nfsd+xfs spins in i_size_read()
      ... >> On the NFS server I'm exporting an XFS filesystem to the client ... The client mounts using ... the server locks up. ...
      (Linux-Kernel)
    • Re: Should COBOL be lockedUP for good?...
      ... How do you _know_ that the locks will be released automatically? ... If a client machine crashes or just stops then the ... server simply never gets another message. ... gain is saving of network time, disk transfers, head moves. ...
      (comp.lang.cobol)
    • Re: Locks, Scope & Performance
      ... A query that brings the server to its knees is often a sign ... Would the process you are suggesting look like a proc that calls a sub> proc ... > and creates w/recompile an inner sProc? ... >> page locks or no locks instead. ...
      (microsoft.public.sqlserver.programming)