Download Install Tutorial Docs FAQ Tools WikiLicense Team IRC Planet Involvement Shop Book

Ticket #92 (defect)

Opened 3 years ago

Last modified 2 years ago

ab stress test randomly breaks hello.py server

Status: closed (fixed)

Reported by: gp.ciceri@acm.org Assigned to: rdelon
Priority: normal Milestone:
Component: CherryPy code Keywords: apache benchmark stress test
Cc:

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

Change History

01/21/05 05:57:04: Modified by rdelon

  • status changed from new to closed.
  • resolution set to fixed.

It's not a bug and there is nothing to worry about ... See http://trac.cherrypy.org/cgi-bin/trac.cgi/wiki/CherryPyBrokenPipe

01/21/05 15:02:38: Modified by rdelon

10/30/06 04:05:41: Modified by 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.

10/30/06 04:16:30: Modified by lawouach

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.

10/30/06 11:34:07: Modified by fumanchu

10/30/06 11:35:30: Modified by fumanchu

  • description changed.

10/30/06 17:18:49: Modified by bugs@tweak.net.au

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

10/30/06 17:25:23: Modified by guest

Note, disabling logging doesn't make the errors go away, I just don't get to see the log anymore.

Hosted by WebFaction

Log in as guest/cpguest to create tickets