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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T17:53:54+00:00 2026-05-13T17:53:54+00:00

I am using Django to handle fairly long http post requests and I am

  • 0

I am using Django to handle fairly long http post requests and I am wondering if my setup has some limitations when I received many requests at the same time.

lighttpd.conf fcgi:

fastcgi.server = (
  "a.fcgi" => (
    "main" => (
      # Use host / port instead of socket for TCP fastcgi
      "host" => "127.0.0.1",
      "port" => 3033,
      "check-local" => "disable",
      "allow-x-send-file" => "enable"
  ))
)

Django init.d script start section:

start-stop-daemon --start --quiet \
  --pidfile /var/www/tmp/a.pid \
  --chuid www-data --exec /usr/bin/env -- python \
  /var/www/a/manage.py runfcgi \
  host=127.0.0.1 port=3033 pidfile=/var/www/tmp/a.pid

Starting Django using the script above results in a multi-threaded Django server:

www-data   342  7873  0 04:58 ?        00:01:04 python /var/www/a/manage.py runfcgi host=127.0.0.1 port=3033 pidfile=/var/www/tmp/a.pid
www-data   343  7873  0 04:58 ?        00:01:15 python /var/www/a/manage.py runfcgi host=127.0.0.1 port=3033 pidfile=/var/www/tmp/a.pid
www-data   378  7873  0 Feb14 ?        00:04:45 python /var/www/a/manage.py runfcgi host=127.0.0.1 port=3033 pidfile=/var/www/tmp/a.pid
www-data   382  7873  0 Feb12 ?        00:14:53 python /var/www/a/manage.py runfcgi host=127.0.0.1 port=3033 pidfile=/var/www/tmp/a.pid
www-data   386  7873  0 Feb12 ?        00:12:49 python /var/www/a/manage.py runfcgi host=127.0.0.1 port=3033 pidfile=/var/www/tmp/a.pid
www-data  7873     1  0 Feb12 ?        00:00:24 python /var/www/a/manage.py runfcgi host=127.0.0.1 port=3033 pidfile=/var/www/tmp/a.pid

In lighttpd error.log, I do see load = 10 which shows I am getting many requests at the same time, this happens few times a day:

2010-02-16 05:17:17: (mod_fastcgi.c.2979) got proc: pid: 0 socket: tcp:127.0.0.1:3033 load: 10

Is my setup correct to handle many long http post requests (can last few minutes each) at the same time ?

  • 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-13T17:53:54+00:00Added an answer on May 13, 2026 at 5:53 pm

    I think you may want to configure your fastcgi worker to run multi-processed, or multi-threaded.

    From manage.py runfcgi help:

    method=IMPL          prefork or threaded (default prefork)
    [...]
    maxspare=NUMBER      max number of spare processes / threads
    minspare=NUMBER      min number of spare processes / threads.
    maxchildren=NUMBER   hard limit number of processes / threads
    

    So your start command would be:

    start-stop-daemon --start --quiet \
      --pidfile /var/www/tmp/a.pid \
      --chuid www-data --exec /usr/bin/env -- python \
      /var/www/a/manage.py runfcgi \
      host=127.0.0.1 port=3033 pidfile=/var/www/tmp/a.pid \
      method=prefork maxspare=4 minspare=4 maxchildren=8
    

    You will want to adjust the number of processes as needed. Note that the more FCGI processes you have, your memory usage will increase linearly. Also, if your processes are CPU-bound, having more processes than number of available CPU cores won’t help much for concurrency.

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

Sidebar

Related Questions

Using Django's built in models, how would one create a triple-join between three models.
I'm considering using Django for a project I'm starting (fyi, a browser-based game) and
I'm using Django to write a blog app, and I'm trying to implement a
I am having problems using django-tagging . I try to follow the documentation but
I'm using Django and Python 2.6, and I want to grow my application using
I'm using django and when users go to www.website.com/ I want to point them
I am currently using Django to construct JSON encoded objects which a retrieved using
Is it possible to have a variable number of fields using django forms? The
I'm rewriting a PHP+MySQL site that averages 40-50 hits a day using Django. Is
I'm trying to figure out how to implement my first RESTful interface using Django

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.