Issue #92 resolved

ab stress test randomly breaks server

Anonymous created an issue

hi all, testing 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 - GET / HTTP/1.0

Exception happened during processing of request from ('', 34804) Traceback (most recent call last): File "/usr/src/build/394694-i386/install/usr/lib/python2.3/", line 222, in handle_request self.process_request(request, client_address) File "/usr/src/build/394694-i386/install/usr/lib/python2.3/", line 241, in process_request self.finish_request(request, client_address) File "/usr/src/build/394694-i386/install/usr/lib/python2.3/", line 254, in finish_request self.RequestHandlerClass(request, client_address, self) File "/usr/src/build/394694-i386/install/usr/lib/python2.3/", line 521, in init self.handle() File "/usr/src/build/394694-i386/install/usr/lib/python2.3/", line 324, in handle self.handle_one_request() File "/usr/src/build/394694-i386/install/usr/lib/python2.3/", line 318, in handle_one_request method() File "/usr/lib/python2.3/site-packages/cherrypy/", line 127, in do_GET self.wfile File "/usr/lib/python2.3/site-packages/cherrypy/", 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/", line 254, in write self.flush() File "/usr/src/build/394694-i386/install/usr/lib/python2.3/", 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

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:

    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 (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 ^(.*)$1 [P]
        RewriteLog /var/log/apache2/
        RewriteLogLevel 1

    When I run pennave as myself, ie,

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

    Everything works fine. When I use the script from (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/", line 75, in wsgiApp
      File "/usr/lib/python2.4/site-packages/cherrypy/", line 78, in run
        _cputil.get_special_attribute("_cp_log_access", "_cpLogAccess")()
      File "/usr/lib/python2.4/site-packages/cherrypy/", 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