473,606 Members | 2,200 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Cache::Cache Stale Segments

Hello,
I'm using Cache::SharedMe moryCache 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 1530

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

Similar topics

1
1484
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 retrieving and parsing it every time.
0
1053
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 this involves maintenance, etc.... Question: Has anyone seen any measurable improvement in doing this, vs. just creating a huge key_cache and being done with it. Thanks.
2
1799
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 included? Do they coexist? 2. Is Singleton the kind of default storage method relating to application wide memory - Is it different in web vs Win apps? 3. Should we just use the ASPNET cache for web apps and the CAB for Win
6
1980
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 ) { HttpContext.Current.Cache = GetCategoriesFromDB(); } return (DataView)HttpContext.Current.Cache;}
5
2109
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); I don't know which namespace to use.
10
9034
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 are NOT tech savvy, and wouldn't know what a "hard refresh" is, nor that it needed to be done.
9
2560
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
2429
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
2326
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 hour" Can anyone kindly help me ?
0
8015
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8439
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8430
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8094
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
6770
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
5966
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5465
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
3977
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1296
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.