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

  • Home
  • SEARCH
  • 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

Ask A Question

Stats

  • Questions 318k
  • Answers 318k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer Edit: Updated the algorithm to reflect what the OP wanted.… May 13, 2026 at 11:50 pm
  • Editorial Team
    Editorial Team added an answer diff -U 0 file1 file2 | grep -v ^@ |… May 13, 2026 at 11:50 pm
  • Editorial Team
    Editorial Team added an answer I solved the problem by returning base64string rather than a… May 13, 2026 at 11:50 pm

Related Questions

I am currently using Django to construct JSON encoded objects which a retrieved using
I have python threaded application + Postgres. I am using Django's ORM to save
I am using django-compress with far future expires for my css and js files.
Alright, this is probably a really silly question but I am new to Python/Django
I am using the latest checkout of the django trunk - when I am

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

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.