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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T10:39:25+00:00 2026-06-10T10:39:25+00:00

I have a simple twisted app that serves Hello World! via HTTP protocol. I

  • 0

I have a simple twisted app that serves “Hello World!” via HTTP protocol. I am trying to run several instances to make use of all processors.

But I mentioned that single twisted app handles much more requests than even 1, 2, or 5 instances of the same app behind the haproxy. I can’t figure out why is this happening.

I run 5000 threads getting / via JMeter. When I run it on 127.0.0.1:9001 it handles each request successfully in 500ms time. When I run it on 127.0.0.1:8080 some of responses are 503 Service Unavailable and some run more than 500ms.

Here is my configuration file:

global
    maxconn 500000
    user german

defaults
    mode http
    retries 0
    timeout connect 5000ms
    timeout client 50000ms
    timeout server 50000ms
    balance roundrobin
    # if something goes wrong with server, redistribute client to a working server
    option redispatch

listen http 127.0.0.1:8080
    mode http
    option httpchk GET / HTTP/1.1

    server prototype-local 127.0.0.1:9001 maxconn 0 weight 1 maxqueue 0 cookie server01 check inter 5000 rise 1 fall 3

    balance roundrobin

    # to see ip's of clients
    option forwardfor
    option http-server-close
    # disable or enable immediate session resource cleaning(useful for chat)
    # option nolinger
    # inserts cookie to each client requet to identify a process
    cookie SWCOMMET insert indirect nocache
    # will be enalbed as soon as main server with process crashed :nice fail resistance
    option allbackups
  • 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-10T10:39:27+00:00Added an answer on June 10, 2026 at 10:39 am

    When I run it on 127.0.0.1:9001 it handles each request successfully in 500ms time

    Are you kidding ? If an application as simple as a “hello world” responds in 500ms, for sure there is something broken somewhere.

    You should check that your server is not swapping (eg: due to a memory leak), which could explain such a huge response time and why it’s even worse when you add haproxy in the chain since both processes would then be affected.

    The fact that you get a 503 from haproxy means that it lost the server which failed to respond to health checks. This is in line with the huge response time BTW.

    It is also possible that for any reason the application is eating all the CPU and incurs high scheduling latencies to haproxy if it’s bound to the same CPU. You should monitor CPU usage and see on which CPU each process runs (use “top” for this). Ideally you should force haproxy to a specific core (using taskset) and your application to another core. Avoiding thread migrations across cores is critical to achieve high loads, so each new instance will have to run on a dedicated core.

    If the server is eating a lot of memory, you should use haproxy’s server maxconn parameter to serialize the requests (and remove maxqueue).

    Among the other things I’m seeing in your haproxy config, the global maxconn is huge and does not make much sense, as you’d need around 9 GB of RAM just for haproxy in order to reach this limit. Also, you need to set a maxconn value in your defaults section, as the default value for a frontend is 2000, which probably is lower than what you’re trying.

    You should remove “maxconn 0”, “maxqueue 0” and “weight 1” as they’re default and only complicate understanding of the config.

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

Sidebar

Related Questions

I have a problem with using Twisted for simple concurrency in python. The problem
I have written a simple automation script for deploying and restarting my twisted application
I have simple php validation form that is halfway working. If you leave the
I have simple win service, that executes few tasks periodically. How should I pass
I'm trying to write a simple mail server using Python. I found smtpd that
I'm trying to implement a fairly simple card game in Python so that two
I have simple node js http server. var http = require(http); http.createServer(function(request, response) {
I'm trying to do some benchmarking of Twisted & Tornado with Mongodb. I have
I have this simple Twisted Client which connects to a Twisted server & queries
I have created a simple Twisted based TCP server and Android client. I have

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.