Note that there are some explanatory texts on larger screens.

plurals
  1. POmod_wsgi fails under pressure
    text
    copied!<p>I tried to stress my server a little, and something weird happened. I'm using mod_wsgi, with basic script plugged in:</p> <pre><code>import socket def application(environ, start_response): status = '200 OK' output = 'Hello World!' response_headers = [('Content-type', 'text/plain'), ('Content-Length', str(len(output)))] start_response(status, response_headers) return [output] </code></pre> <p>I tried to stress it a little with simple "hit it all I can":</p> <pre><code>#!/bin/zsh for i in {1..50} do wget http://$this_site/ &amp; done </code></pre> <p>And weird thing happened - wget thrown at me reports about error 500 on server.</p> <p>when I checked out apache logs, this is what I found</p> <pre><code>[Sat Mar 10 21:46:18 2012] [error] [client 95.49.81.25] mod_wsgi (pid=23632): Target WSGI script '/home/tricky/www/run.py' cannot be loaded as Python module. [Sat Mar 10 21:46:18 2012] [error] [client 95.49.81.25] mod_wsgi (pid=23632): Exception occurred processing WSGI script '/home/tricky/www/run.py'. [Sat Mar 10 21:46:18 2012] [error] [client 95.49.81.25] Traceback (most recent call last): [Sat Mar 10 21:46:18 2012] [error] [client 95.49.81.25] File "/home/tricky/www/run.py", line 1, in &lt;module&gt; [Sat Mar 10 21:46:18 2012] [error] [client 95.49.81.25] import web [Sat Mar 10 21:46:18 2012] [error] [client 95.49.81.25] File "/usr/local/lib/python2.7/site-packages/web.py-0.36-py2.7.egg/web/__init__.py", line 14, in &lt;module&gt; [Sat Mar 10 21:46:18 2012] [error] [client 95.49.81.25] import utils, db, net, wsgi, http, webapi, httpserver, debugerror [Sat Mar 10 21:46:18 2012] [error] [client 95.49.81.25] File "/usr/local/lib/python2.7/site-packages/web.py-0.36-py2.7.egg/web/wsgi.py", line 8, in &lt;module&gt; [Sat Mar 10 21:46:18 2012] [error] [client 95.49.81.25] import http [Sat Mar 10 21:46:18 2012] [error] [client 95.49.81.25] ImportError: No module named http </code></pre> <p>How is this possible? And why is it happening?</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload