473,320 Members | 2,035 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

Cache::Cache Stale Segments

Hello,
I'm using Cache::SharedMemoryCache with an Apache 1.3.28 / mod_perl
1.28 / Mason instance on RedHat Linux 7.2. The caching mechanism
seems to work fine, it creates one shared memory segment and one
semophore when in use. What I noticed was that when I gracefully shut
apache down (completely), the segment and semaphore remain. I believe
this is mostly intentional from design, but I would like to be able to
remove any shared memory explicitly set by the application upon the
apache parent process shutdown, via an END{} block in my startup.pl.
Kind of like how Apache automatically removes its own shared memory
segment

ipcs:
key shmid owner perms bytes nattch
status
0x00000000 2326529 apache 600 46084 1 dest
I've tried using the built in methods from Cache::Cache (Clear(),
Purge(), remove()) to destroy the shared memory, but all it does is
wipe out the keys and their respective data, it doesn't get rid of the
actual segment/semaphore allocation in the OS. So, I've just been
resorting to using ipcrm manually after I shut apache down.

Since my keys stay the same for my shared data, Apache utilizes the
already allocated segment/semaphore upon restart, so there is no leak
issue. But the ops personnel who maintain the application don't like
having stale shared memory allocations hanging around once the
process(es) that is using them (apache) is shut down. Besides, by
design, the cache is cleared on startup and reloaded then anyway,
there's no business reason to keep the data there when there are no
processes accessing it.

Anyone have any suggestions on how I can take care of this
automatically during Apache's shutdown process? Or at least, how I
can get access to the shared mem id that Linux provides when the
memory is allocated? That way I could at least 'system()' out ipcrm
calls upon a graceful shutdown. Short of modifying the code in
Cache::Cache myself to meet my own needs, I'm not sure how to do any
of this.

Thanks in advance,
- Jeff
Jul 19 '05 #1
0 1507

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Charles Fineman | last post by:
I realize there are issues with the cached schema getting stale but I would like to know if any (many? most?) of the XML parsers out there cache a representation of the schema (or DTD) rather than...
0
by: steve | last post by:
In mysql 4.1, there are new ways to save different index files into different key_cache segments. The idea is to remove problems with key_cache locking if another process is accessing it. As...
2
by: Harry Simpson | last post by:
If anyone can chime in on these questions, I'd sure appreciate it. 1. How does the cache block fit in with the UIP Block - Is the "state" managed there handled any differently with the CAB...
6
by: Charts | last post by:
I used HttpContext.Current.Cache To cache data from database. The code is like that. public static DataView GetCategories() { if ( HttpContext.Current.Cache == null ) {...
5
by: Stan SR | last post by:
Hi, Some newbie questions.. :-) First, what is the namespace to use for the Cache class ? When I use this bit of code I get an error if (Cache==null) Cache.Insert("myUserList",userlist);...
10
by: hughestroop | last post by:
I have updated my CSS and if you view the main page with the old css cached, it breaks the page. Is there any way to force viewers that have the old css cached to get the new css? Our viewers...
9
by: Michael M. | last post by:
Hi all, I would like to know how to access the NT/2000/XP/2003 Name cache; what I mean by this is: Open a Command Prompt and.., C:\> C:\>IPCONFIG /DISPLAYDNS
5
by: =?iso-8859-1?B?TWF0dGlhcyBCcuRuZHN0cvZt?= | last post by:
Hello! I have a question about filecmp.cmp(). The short code snippet blow does not bahave as I would expect: import filecmp f0 = "foo.dat" f1 = "bar.dat"
3
vikas1111
by: vikas1111 | last post by:
Hi All. I want to know how to alter Cache timing in Magpie. I tried to edit rss_cache.inc to 10 seconds but its not working. "var $MAX_AGE = 10; // when are files stale, default one...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.