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 8424065
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T03:53:20+00:00 2026-06-10T03:53:20+00:00

I am trying to use a middleware to profile a WSGI application. This middleware

  • 0

I am trying to use a middleware to profile a WSGI application. This middleware uses plop which is a low overhead profiler for python that relies on the signal module.

If I run a Django app which uses this middleware by running ./manage.py runserver --forked then it middleware works as expected. However when the same Django app is running on apache via mod_wsgi then it does not work as intended.

The mod_wsgi instance is configured with WSGIRestrictSignal Off and WSGIDaemonProcess example processes=5 threads=1 and when the Django app is run the following error occurs:

ValueError: signal only works in main thread

This is the same error that occurs if I run the development server without the --forked flag. I don’t think it should be occurring with apache because the number of threads is 1.

What can I do to fix this?

  • 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-06-10T03:53:21+00:00Added an answer on June 10, 2026 at 3:53 am

    Using a background thread which does a sleep() between samples should technically work and have used that approach before when have done this myself.

    There is an example of creating a background thread for this purpose in:

    http://code.google.com/p/modwsgi/wiki/DebuggingTechniques#Extracting_Python_Stack_Traces

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

Sidebar

Related Questions

I am trying to build a middleware application that functions in between the user
Trying to make a django test application which will use stored oracle's procedures to
I am trying use gem tire to search in my application. I have tables
I am need paint my image. I'm trying use JQuery in here this link:
I am trying to use session variable( $_SESSION['asc_id'] , which holds some value like
I'm trying to use PDFKit as middleware in a rails 3 app. I can
I am trying to use an OmniAuth (0.2.6) strategy for my application. The architecture
i'm trying use webview to load a image from sdcard i use this path
I have a regex that I'm trying use to validate against strings. Trying to
I have a 3rd party DLL that I am trying to use in a

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.