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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T15:04:28+00:00 2026-06-08T15:04:28+00:00

I start a tornado http server like this: app = tornado.web.Application([ (r’.*’, MyRequestHandler), ])

  • 0

I start a tornado http server like this:

app = tornado.web.Application([
    (r'.*', MyRequestHandler),
])

http_server = tornado.httpserver.HTTPServer(app, no_keep_alive=True)
http_server.listen(port)
ioloop = tornado.ioloop.IOLoop.instance()

ioloop.start()

I want to ingore request with header Connection: keep-alive then set no_keep_alive to True.

when I run

ab -n 1000 -c 10 -k http://127.0.0.1:28000/

output

Benchmarking 127.0.0.1 (be patient)
apr_socket_recv: Connection reset by peer (104)
Total of 11 requests completed

when I remove -k, everything is working well.

  • 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-08T15:04:31+00:00Added an answer on June 8, 2026 at 3:04 pm

    If short – because apache benchmark opens connection once on tests. In your case, you have 10 connections – and all of them killed after first 10 requests.

    Here is code of finish request for HTTPConnection from tornado.

    def _finish_request(self):
        if self.no_keep_alive:
            disconnect = True
        else:
            connection_header = self._request.headers.get("Connection")
            if connection_header is not None:
                connection_header = connection_header.lower()
            if self._request.supports_http_1_1():
                disconnect = connection_header == "close"
            elif ("Content-Length" in self._request.headers
                    or self._request.method in ("HEAD", "GET")):
                disconnect = connection_header != "keep-alive"
            else:
                disconnect = True
        self._request = None
        self._request_finished = False
        if disconnect:
            self.stream.close()
            return
        self.stream.read_until(b("\r\n\r\n"), self._header_callback)
    

    Your error:

    apr_socket_recv: Connection reset by peer (104)
    

    As we can guess, you must force apache benchmark to open new connection, if old connection closed. I am not sure if you will able to get representative results in this case.

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

Sidebar

Related Questions

I have this code (hello.py): import os,sys import tornado.ioloop import tornado.web import tornado.httpserver #http
I have a simple tornado server running like this: import json import suds from
I'm trying to deploy a web app in Brubeck , a tornado-like python framework
I just start learning Python + Tornado for my web servers. Every time I
I'm quite new to using Tornado Web as a web server, and am having
I've set up a Flask application to run on a tornado server backed by
Start a new web application using NetBeans 7 on GlassFish 3.1 In index.xhtml body
I start working at an existing project (an web application) that was created by
I've been playing around a bit with the Tornado web server and have come
How to listen for the connections on Tornado Web Server coming not from local

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.