On 07/02/2015, at 8:42 AM, Paul Royik <[email protected]> wrote:

> In fact traffic is not very heavy.
> 3000 pageviews per day.
> 
> "how long do the requests run for" don't know. How to measure that? I have 
> one page, that can run up to 150 sec. before timeout. Do I need to lower?
> 
> Below is the part of error log:
> [Fri Feb 06 12:39:06.288100 2015] [wsgi:info] [pid 9731:tid 140179136616192] 
> mod_wsgi (pid=9731): called from file 
> "/home/simamura/webapps/django_math/mathsite/mathsite/utils.py", line 352, in 
> run,
> [Fri Feb 06 12:39:06.288103 2015] [wsgi:info] [pid 9731:tid 140179136616192] 
> mod_wsgi (pid=9731): called from file 
> "/usr/local/lib/python2.7/threading.py", line 792, in __bootstrap_inner,
> [Fri Feb 06 12:39:06.288107 2015] [wsgi:info] [pid 9731:tid 140179136616192] 
> mod_wsgi (pid=9731): called from file 
> "/usr/local/lib/python2.7/threading.py", line 769, in __bootstrap.
> [Fri Feb 06 12:39:11.254220 2015] [wsgi:info] [pid 9731:tid 140177922582272] 
> mod_wsgi (pid=9731): Aborting process 'localhost:20241'.
> [Fri Feb 06 12:39:11.254246 2015] [wsgi:info] [pid 9731:tid 140177922582272] 
> mod_wsgi (pid=9731): Exiting process 'localhost:20241'.
> [Fri Feb 06 18:39:11.286257 2015] [wsgi:error] [pid 31992:tid 
> 140179135010560] [client 127.0.0.1:43870] Truncated or oversized response 
> headers received from daemon process 'localhost:20241': 
> /home/simamura/webapps/django_math/express/htdocs/calculators, referer: 
> http://www.emathhelp.net/calculators/calculus-2/integral-calculator/
> [Fri Feb 06 18:39:11.286363 2015] [wsgi:error] [pid 31149:tid 
> 140179069642496] [client 127.0.0.1:43747] Truncated or oversized response 
> headers received from daemon process 'localhost:20241': 
> /home/simamura/webapps/django_math/express/htdocs/calculators, referer: 
> http://www.emathhelp.net/calculators/calculus-2/integral-calculator/
> [Fri Feb 06 18:39:11.286447 2015] [wsgi:error] [pid 31149:tid 
> 140179135543040] [client 127.0.0.1:43796] Truncated or oversized response 
> headers received from daemon process 'localhost:20241': 
> /home/simamura/webapps/django_math/express/htdocs/calculators, referer: 
> https://www.google.com/
> [Fri Feb 06 18:39:12.131163 2015] [wsgi:info] [pid 22495:tid 140179136616192] 
> mod_wsgi (pid=9731): Process 'localhost:20241' has died, deregister and 
> restart it.
> [Fri Feb 06 18:39:12.131193 2015] [wsgi:info] [pid 22495:tid 140179136616192] 
> mod_wsgi (pid=9731): Process 'localhost:20241' has been deregistered and will 
> no longer be monitored.
> [Fri Feb 06 18:39:12.131470 2015] [wsgi:info] [pid 12495:tid 140179136616192] 
> mod_wsgi (pid=12495): Starting process 'localhost:20241' with threads=5.
> [Fri Feb 06 18:39:12.131613 2015] [wsgi:info] [pid 12495:tid 140179136616192] 
> mod_wsgi (pid=12495): Python home /usr/local.
> [Fri Feb 06 18:39:12.131626 2015] [wsgi:info] [pid 12495:tid 140179136616192] 
> mod_wsgi (pid=12495): Initializing Python.
> [Fri Feb 06 18:39:12.184325 2015] [wsgi:info] [pid 12495:tid 140179136616192] 
> mod_wsgi (pid=12495): Attach interpreter ''.
> [Fri Feb 06 18:39:12.207432 2015] [wsgi:info] [pid 12495:tid 140179136616192] 
> mod_wsgi (pid=12495): Imported 'mod_wsgi'.

Can you go back to before that traceback at start appears? Capture about a 
dozen lines before the stack frame lines started.

It does look like the request timeout.

Change express-config to have:

mod_wsgi-express setup-server \
    --working-directory ${SITE_NAME} \
    --server-root express \
    --port ${SITE_PORT} \
    --log-directory ${LOG_DIR} \
    --access-log --access-log-format "${LOG_FORMAT}" \
    --access-log-name access_${APPL_NAME}.log \
    --error-log-name error_${APPL_NAME}.log \
    --python-path ${SITE_ROOT}/lib/python${PYTHON_VERSION} \
    --request-timeout 300 \
    $SITE_NAME/$SITE_NAME/wsgi.py

So have added the --request-timeout option, increasing it from nominal 60 
seconds to 300 seconds.

It isn't a hard 60 seconds because is a multithreaded process and that changes 
how it works so is actually variable. Too complicated to explain right now.

After you do make changes to express-config, remember to rerun it.

You can then run:

    $HOME/webapps/django_math/express/apachectl restart

to have Apache reread the configuration.

Graham

-- 
You received this message because you are subscribed to the Google Groups 
"modwsgi" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/modwsgi.
For more options, visit https://groups.google.com/d/optout.

Reply via email to