Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7458935
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T13:50:02+00:00 2026-05-29T13:50:02+00:00

I have written a perl XSUB wrapper for a very simple C API (for

  • 0

I have written a perl XSUB wrapper for a very simple C API (for which I dont have the source).

The C API consists of 4 functions. One of which returns a “handle” (just an int) and this value must be passed back to any of the other 3 functions to get the right internal “object” to call. One assumes the C API is keeping a list of these objects and dishing the right one out for the supplied handle.

When running in a standalone script, everything works great.

I’m now trying to get this API running under apache2 with mod_perl. Initially, everything works fine – I return the “handle” back to the client and the client then makes subsequent calls with the same handle value. But, after a (very short) period of inactivity, the C API decides that it has lost it’s lists of “objects” and starts over.

I assume this is because the underlying .so file is being unloaded.

So, my question:

Is there anything I can do to prevent apache/perl unloading this .SO? The only thing that seems to work is running apache in debug mode with -X.

Thanks

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-29T13:50:04+00:00Added an answer on May 29, 2026 at 1:50 pm

    I assume that the issue is that the SO has to do a lot of initialisation for the first request, and you want to avoid doing this repeatedly.

    It may help if you tweak the MPM settings.

    According to the MPM documentation, you can avoid the child processes being terminated and restarted, by setting the appropriate directives.

    In addition to the set of active child processes, there may be additional child processes which are terminating but where at least one server thread is still handling an existing client connection. Up to MaxClients terminating processes may be present, though the actual number can be expected to be much smaller. This behavior can be avoided by disabling the termination of individual child processes, which is achieved by the following:

    • set the value of MaxRequestsPerChild to zero

    • set the value of MaxSpareThreads to the same value as MaxClients

    This means that the two mechanisms for regulating the lifetime of child processes are turned off. First, processes terminate and restart automatically after MaxRequestsPerChild. Setting it to zero disables this. Second, if there are more than MaxSpareThreads sitting idle, child processes may be culled to conserve server resources. The second directive disables that process.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have written a XS based Perl module which provides access to functions in
I have written a simple perl script to read a line from a .csv
I have a tool written in perl which is used by different users in
I have written a Perl CGI script which fetches an html page from a
The situation I am in is that I have written a perl script which
I have written a Perl script that performs many one-sample t-tests. I get thousands
I have written a Perl script which opens a directory consisting of various files.
I have written a Perl XS wrapper for a C library consisting of about
I have written a small script in Perl which I am executing on Windows
I have written a simple module to store and manipulate an ontology which is

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.