Issue #92 resolved

ab stress test randomly breaks hello.py server

Anonymous created an issue

hi all, testing hello.py from tutorial (plain vanilla config) with apache benchmark ab -n 2000 -c 5 http://localhost:8080/ randomly breaks the server. I take this on server log after the test finishes. The server itself stay up. If I try with -c 1 (1 concurrent request) it seems it's all o.k.

{{{ 2005/01/21 11:17:26 HTTP INFO 127.0.0.1 - GET / HTTP/1.0

Exception happened during processing of request from ('127.0.0.1', 34804) Traceback (most recent call last): File "/usr/src/build/394694-i386/install/usr/lib/python2.3/SocketServer.py", line 222, in handle_request self.process_request(request, client_address) File "/usr/src/build/394694-i386/install/usr/lib/python2.3/SocketServer.py", line 241, in process_request self.finish_request(request, client_address) File "/usr/src/build/394694-i386/install/usr/lib/python2.3/SocketServer.py", line 254, in finish_request self.RequestHandlerClass(request, client_address, self) File "/usr/src/build/394694-i386/install/usr/lib/python2.3/SocketServer.py", line 521, in init self.handle() File "/usr/src/build/394694-i386/install/usr/lib/python2.3/BaseHTTPServer.py", line 324, in handle self.handle_one_request() File "/usr/src/build/394694-i386/install/usr/lib/python2.3/BaseHTTPServer.py", line 318, in handle_one_request method() File "/usr/lib/python2.3/site-packages/cherrypy/_cphttpserver.py", line 127, in do_GET self.wfile File "/usr/lib/python2.3/site-packages/cherrypy/_cphttptools.py", line 244, in doRequest wfile.write('%s 200 OK\r\n' % cpg.configOption.protocolVersion) File "/usr/src/build/394694-i386/install/usr/lib/python2.3/socket.py", line 254, in write self.flush() File "/usr/src/build/394694-i386/install/usr/lib/python2.3/socket.py", line 241, in flush self._sock.sendall(buffer) error: (32, 'Broken pipe') }}}

This either on FC2 (stock python 2.3.4) or win2k (activepython 2.3.4). I'm using latest official CP2 beta from sourceforge.

TIA /gp

Reported by gp.ciceri@acm.org

Comments (9)

  1. guest

    Actually, neither URL works.

    I get broken pipe errors if cherry py runs as the web server user (as set out here: http://trac.cherrypy.org/wiki/BehindApache)

    Almost every page request will give me one, or more broken pipes (Running PennAve, which is a cherry py app)

    If I run it as myself, from the command line it always works.

    Would love to read this page about broken pipes in cherry py.

  2. Anonymous

    Then could you please give us more information:

    - CherryPy eact version - Apache version - Apache config for CP (mod_rewrite rules) - Error logs

    We cannot re-open without those details.

  3. Anonymous

    CherryPy 2.2.1, python 2.4.3, apache2.0.55

    I'm using PennAve, a gallery package from http://pennave.sourceforge.net/ (version 0.3)

    The apache config is:

        RewriteEngine on
        RewriteRule ^/static/(.*) /home/karl/src/pennave-0.3/static/$1 [L]
        RewriteCond %{SCRIPT_FILENAME} !restart\.cgi$
        RewriteRule ^(.*) http://127.0.0.1:8000$1 [P]
        RewriteLog /var/log/apache2/rewrite.log.art
        RewriteLogLevel 1
    

    When I run pennave as myself, ie,

    ''karl@zin:/src/pennave-0.3$ python pennave.py --conf my.conf''

    Everything works fine. When I use the script from http://docs.cherrypy.org/apache-proxy (autostart.cgi) generally at least one of the hits for a page will cause a Broken Pipe. Sometimes just an image thumbnail, but sometimes the css file, or even "Unrecoverable server error"

    Sorry, I didn't include any of this earlier, as I wanted to see what this page was about, and see if there was anything that I just wasn't doing. Also, I can't think of any reason why the user running cherry py should have any affect. PennAve _does_ need to write to a couple of locations, but I've made them all world writeable. Here's a sample traceback...

    Traceback (most recent call last):
      File "/usr/lib/python2.4/site-packages/cherrypy/_cpwsgi.py", line 75, in wsgiApp
        environ['wsgi.input'])
      File "/usr/lib/python2.4/site-packages/cherrypy/_cphttptools.py", line 78, in run
        _cputil.get_special_attribute("_cp_log_access", "_cpLogAccess")()
      File "/usr/lib/python2.4/site-packages/cherrypy/_cputil.py", line 124, in _cp_log_access
        print s
    IOError: [Errno 32] Broken pipe
    
    

    It seems to be trying to log access, which would be the server.log_file and server.log_access_file config settings, but both of those files are world writeable.

    Cheers, Karl P

  4. Log in to comment