10 second repsone time on hello world example?

Issue #34 invalid
Mike D created an issue

I am trying to run the Hello World example from the docs, It gives me a 10+ second response time per request.

Something must be wrong but dont know exactly what is happening that creates this.

running in virtualbox Ubuntu 12.04 64 bit, app.py is located in shared folder.

wheezy.web version

pip show wheezy.web
---
Name: wheezy.web
Version: 0.1.482
Location: /usr/local/lib/python2.7/dist-packages
Requires: wheezy.core, wheezy.caching, wheezy.html, wheezy.http, wheezy.routing, wheezy.security, wheezy.validation

app.py

from wheezy.http import HTTPResponse
from wheezy.http import WSGIApplication
from wheezy.routing import url
from wheezy.web.handlers import BaseHandler
from wheezy.web.middleware import bootstrap_defaults
from wheezy.web.middleware import path_routing_middleware_factory


class WelcomeHandler(BaseHandler):

    def get(self):
        response = HTTPResponse()
        response.write('Hello World!')
        return response


def welcome(request):
    response = HTTPResponse()
    response.write('Hello World!')
    return response


all_urls = [
    url('', WelcomeHandler, name='default'),
    url('welcome', welcome, name='welcome')
]


options = {}
main = WSGIApplication(
    middleware=[
        bootstrap_defaults(url_mapping=all_urls),
        path_routing_middleware_factory
    ],
    options=options
)


if __name__ == '__main__':
    from wsgiref.simple_server import make_server
    try:
        print('Visit http://localhost:8080/')
        make_server('0.0.0.0', 80, main).serve_forever()
    except KeyboardInterrupt:
        pass
    print('\nThanks!')

Comments (3)

  1. Mike D reporter

    if i wget from local machine this doesn't seem to happen, only from browser over LAN? Something weird is happening.

  2. Andriy Kornatskyy repo owner

    I noticed you are using a privileged port 80. Do you have the same issue if you change it to 8080 instead?

  3. Log in to comment