logo       


RE: remote: msg#00042

Subject: RE: remote
Sure.

The changes for the threading are all in CacheEventQueue, and
ElementEventQueue.

The original design spawned one thread for each region immediately, and had
the thread sleep until there was events in the queue to process.

My change was to have it spawn the thread the first time an item entered the
queue, and run until the queue was empty. When the queue was empty, the
thread would sleep for a specified period of time. If another event came
into the queue while the thread was sleeping, it would wake up and resume
processing. If the thread sleep period expired without another event coming
into the queue, the thread would die, leaving a new thread to be created
with an event came in.

Thus, an active queue would always have a thread available and ready to
process events. An inactive queue's thread won't ever get spawned. A
semi-active queue can be tuned for best behavior via the timeout. The
problem was that assuming you had 1,000 regions, it would instantly spawn
1,000 threads, even if only 20 regions were getting used. On some operating
systems, this would make the box completely unusable. I suspect this is no
longer as much of a problem with newer kernels like 2.6 on Linux, but rest
assured it's pretty broken on older machines.

The other major important change was (and my memory is failing me as to
where it was exactly) when a client did a remove to a remote cache, the
remote cache would send a remove to all the other clients clients, who would
in return send a remove back to the remote cache, who would send a remove to
all the other clients, ad nasueum, creating (X-1)^2 packets with every
iteration, where X is the number of clients talking to remote cache. It
won't happen with only one client... but it will with 2+.

My fix was a change from a 'remove()' to a 'localRemove()' at a key point...
now if only I could remember where that point was!

The final change, which is less important, but necessary for long-term
stability is to change the cache ID from a byte to an integer. Only
supporting 256 remote clients is all good and fine, but assuming there's 2
clients, and one of them disconnects and reconnects 255 times, it's going to
break in new and interesting ways when the ID wraps back around to 1.

...

The changes I made to the IndexedDisk was to move the logic of figuring out
where in the file to write elements into the IndexedDisk itself, simplifying
the interface from writeObject(Serializable, long) to put(CacheElement), and
readObject(long) to get(key). The actual management of the file itself is
left to the IndexedDisk, leaving the IndexedDiskCache free of the
implementation details of the actual storage of the objects. It just felt
like to me they were too closely coupled. The IndexedDiskCache acts as the
access point to the disk, and encapsulates the read/write locking semantics,
and simply delegates to the IndexedDisk for persistence, rather than
managing part of the process of reading/writing from the disk itself and
delegating part of it to another class. Now it delegates -all- the 'disk
work' to the IndexedDisk.

-Travis Savo




-----Original Message-----
From: Aaron Smuts [mailto:aasmuts@xxxxxxxx]
Sent: Thursday, April 15, 2004 12:43 PM
To: 'Turbine JCS Developers List'
Subject: remote


Hi Travis,

You said you worked on reducing the number of threads used in the remote
cache?  Can you give me some specifics on what you changed and what your
enhancements were.  It sounded like you had some good ideas here.

Also, could you describe in more what changes you made to the disk
cache.  

Thanks,

Aaron




---------------------------------------------------------------------
To unsubscribe, e-mail: turbine-jcs-dev-unsubscribe@xxxxxxxxxxxxxxxxxx
For additional commands, e-mail: turbine-jcs-dev-help@xxxxxxxxxxxxxxxxxx


Ruby Jobs
Java Jobs
Jobs in California
more...
what
job title, keywords
where
city, state, zip
jobs by job search
Search:
Java, servers, webhosting, windows, cisco ...
more...
<Prev in Thread] Current Thread [Next in Thread>
Google Custom Search

Recently Viewed:
encryption.gpg....    ietf.rfc822/199...    freebsd.devel.i...    lang.haskell.li...    mail.squirrelma...    web.zope.plone....    yellowdog.gener...    text.xml.xalan....    recreation.phot...    kde.devel.educa...    hardware.bus.ca...    printing.ghosts...    voip.peering/20...    assembly/2006-0...    org.user-groups...    culture.interne...    network.i2p/200...    boot-loaders.ya...    xfree86.render/...    qnx.openqnx.dev...    jakarta.velocit...    user-groups.pal...   
Home | blog view | USPTO Patent Archive | advertise | OSDir is an inevitable website. super tiny logo

Free Magazines

Cisco News
Receive a free quarterly e-newsletter with exclusive articles on how Cisco IT uses its own products and solutions to enable the business.
subscribe

Systems Management News, the newspaper for IT systems administration and data center managers! Each issue of Systems Management News is chock-full of news and analysis to help you understand what's happening in your field.
subscribe

The Enterprise Newsweekly eWeek is the essential technology information source for builders of e-business.
subscribe

Oracle Magazine Oracle Magazine contains technology strategy articles, sample code, tips, Oracle and partner news, how to articles for developers and DBAs, and more. Oracle (NASDAQ: ORCL) is the world's largest enterprise software company.
subscribe

Total Telecom Total Telecom is "The Economist of the communications industry".
subscribe