Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Newer
Older
100644 130 lines (103 sloc) 4.322 kb
3c76ca4 git-svn-id: svn://cherokee-project.com/cherokee/trunk@1816 5dc97367-9…
taher authored
1 == link:index.html[Index] -> link:dev.html[Development info]
2
3 Development: Debugging Cherokee
4 -------------------------------
280e7d0 Changed documentation to asciidoc
taher authored
5
695401d git-svn-id: svn://cherokee-project.com/cherokee/trunk@2466 5dc97367-9…
taher authored
6 [[cherokee-admin]]
b87e179 git-svn-id: svn://cherokee-project.com/cherokee/trunk@2260 5dc97367-9…
taher authored
7 cherokee-admin
8 ~~~~~~~~~~~~~~
9
10 Cherokee Admin is written in Python. While making changes, you can use
11 the `-x` or `--debug` parameter to see the Python back traces in the
12 active console.
13
14
695401d git-svn-id: svn://cherokee-project.com/cherokee/trunk@2466 5dc97367-9…
taher authored
15 [[cherokee]]
b87e179 git-svn-id: svn://cherokee-project.com/cherokee/trunk@2260 5dc97367-9…
taher authored
16 cherokee
17 ~~~~~~~~
18
1241fcd git-svn-id: svn://cherokee-project.com/cherokee/trunk@1740 5dc97367-9…
taher authored
19 If you need to debug the behavior of the web server (or an
20 application), there are some helpful tools available for you.
280e7d0 Changed documentation to asciidoc
taher authored
21
22 * To start with, if you are using gcc and you want to compile Cherokee
23 with debug information just execute make like this:
9ceefc8 git-svn-id: svn://cherokee-project.com/cherokee/trunk@1767 5dc97367-9…
taher authored
24 +
280e7d0 Changed documentation to asciidoc
taher authored
25 ----
26 make CFLAGS="-O0 -g3"
27 ----
9ceefc8 git-svn-id: svn://cherokee-project.com/cherokee/trunk@1767 5dc97367-9…
taher authored
28 +
29 And then you'll be able to execute gdb, cgdb, gdbtui..
280e7d0 Changed documentation to asciidoc
taher authored
30
31 * You can use autoconf to set up Cherokee to use static modules:
9ceefc8 git-svn-id: svn://cherokee-project.com/cherokee/trunk@1767 5dc97367-9…
taher authored
32 +
280e7d0 Changed documentation to asciidoc
taher authored
33 ----
34 ./autogen.sh --localstatedir=/var --prefix=/usr --sysconfdir=/etc \
35 --with-wwwroot=/var/www --enable-static-module=all --enable-static \
1241fcd git-svn-id: svn://cherokee-project.com/cherokee/trunk@1740 5dc97367-9…
taher authored
36 --enable-shared=no
280e7d0 Changed documentation to asciidoc
taher authored
37 ----
38
e3addf7 @alobbs Adds a new backtracing option. If enabled, the server will print a
alobbs authored
39 * If you want a code backtrace printed each time an error message is
40 generated, add the following `configure` parameter:
41 +
42 ----
43 --enable-backtraces
44 ----
45 +
e9b553f git-svn-id: svn://cherokee-project.com/cherokee/trunk@1721 5dc97367-9…
taher authored
46 * You can also enable a cool feature: the CHEROKEE_TRACE environment
47 variable to trace what is going on inside the server. To enable it
48 you must add a special flag to your `configure` or `autogen.sh`
49 statement:
9ceefc8 git-svn-id: svn://cherokee-project.com/cherokee/trunk@1767 5dc97367-9…
taher authored
50 +
280e7d0 Changed documentation to asciidoc
taher authored
51 ----
52 --enable-trace
53 ----
9ceefc8 git-svn-id: svn://cherokee-project.com/cherokee/trunk@1767 5dc97367-9…
taher authored
54 +
55 This will let you trace the behavior with a human-readable output.
4c26ac8 git-svn-id: svn://cherokee-project.com/cherokee/trunk@1995 5dc97367-9…
taher authored
56 +
57 Note that by enabling tracing you will be making Cherokee a lot
58 slower. Keep this in mind when deploying in production environments.
59 +
9ceefc8 git-svn-id: svn://cherokee-project.com/cherokee/trunk@1767 5dc97367-9…
taher authored
60 Now, when you are going to launch the web server, just add the
61 CHEROKEE_TRACE variable, with the desired options:
62 +
63 ****
280e7d0 Changed documentation to asciidoc
taher authored
64 cherokee# CHEROKEE_TRACE="common" cherokee
9ceefc8 git-svn-id: svn://cherokee-project.com/cherokee/trunk@1767 5dc97367-9…
taher authored
65
54ba86e git-svn-id: svn://cherokee-project.com/cherokee/trunk@2956 5dc97367-9…
taher authored
66 Cherokee Web Server 0.99.3b2955 (Mar 10 2009): Listening on port ALL:80, TLS
4c26ac8 git-svn-id: svn://cherokee-project.com/cherokee/trunk@1995 5dc97367-9…
taher authored
67
54ba86e git-svn-id: svn://cherokee-project.com/cherokee/trunk@2956 5dc97367-9…
taher authored
68 disabled, IPv6 enabled, using epoll, 1024 fds system limit, max. 505
9ceefc8 git-svn-id: svn://cherokee-project.com/cherokee/trunk@1767 5dc97367-9…
taher authored
69
54ba86e git-svn-id: svn://cherokee-project.com/cherokee/trunk@2956 5dc97367-9…
taher authored
70 connections, caching I/O, 10 threads, 50 connections per thread, standard
4b3ba13 git-svn-id: svn://cherokee-project.com/cherokee/trunk@2723 5dc97367-9…
taher authored
71
54ba86e git-svn-id: svn://cherokee-project.com/cherokee/trunk@2956 5dc97367-9…
taher authored
72 scheduling policy
9ceefc8 git-svn-id: svn://cherokee-project.com/cherokee/trunk@1767 5dc97367-9…
taher authored
73
4c26ac8 git-svn-id: svn://cherokee-project.com/cherokee/trunk@1995 5dc97367-9…
taher authored
74 handler_common.c:0143 ( stat_file): /var/www//images/powered_by_cherokee.png, use_iocache=0 re=0
9ceefc8 git-svn-id: svn://cherokee-project.com/cherokee/trunk@1767 5dc97367-9…
taher authored
75
280e7d0 Changed documentation to asciidoc
taher authored
76 handler_common.c:0190 ( cherokee_handler_common_new): request: '/images/powered_by_cherokee.png', local: '/var/www//images/powered_by_cherokee.png', exists 1
9ceefc8 git-svn-id: svn://cherokee-project.com/cherokee/trunk@1767 5dc97367-9…
taher authored
77
280e7d0 Changed documentation to asciidoc
taher authored
78 handler_common.c:0236 ( cherokee_handler_common_new): going for handler_file
9ceefc8 git-svn-id: svn://cherokee-project.com/cherokee/trunk@1767 5dc97367-9…
taher authored
79
280e7d0 Changed documentation to asciidoc
taher authored
80 handler_common.c:0143 ( stat_file): /var/www//images/default-bg.png, use_iocache=0 re=0
9ceefc8 git-svn-id: svn://cherokee-project.com/cherokee/trunk@1767 5dc97367-9…
taher authored
81
280e7d0 Changed documentation to asciidoc
taher authored
82 handler_common.c:0190 ( cherokee_handler_common_new): request: '/images/default-bg.png', local: '/var/www//images/default-bg.png', exists 1
9ceefc8 git-svn-id: svn://cherokee-project.com/cherokee/trunk@1767 5dc97367-9…
taher authored
83
280e7d0 Changed documentation to asciidoc
taher authored
84 handler_common.c:0236 ( cherokee_handler_common_new): going for handler_file
9ceefc8 git-svn-id: svn://cherokee-project.com/cherokee/trunk@1767 5dc97367-9…
taher authored
85
280e7d0 Changed documentation to asciidoc
taher authored
86 handler_common.c:0143 ( stat_file): /var/www//images/cherokee-logo.png, use_iocache=0 re=0
87
9ceefc8 git-svn-id: svn://cherokee-project.com/cherokee/trunk@1767 5dc97367-9…
taher authored
88 handler_common.c:0190 ( cherokee_handler_common_new): request: '/images/cherokee-logo.png', local: '/var/www//images/cherokee-logo.png', exists 1
280e7d0 Changed documentation to asciidoc
taher authored
89
9ceefc8 git-svn-id: svn://cherokee-project.com/cherokee/trunk@1767 5dc97367-9…
taher authored
90 handler_common.c:0236 ( cherokee_handler_common_new): going for handler_file
91 ****
92 +
93 Of course, you can trace all the modules (handlers, loggers..) you need:
94 +
280e7d0 Changed documentation to asciidoc
taher authored
95 ----
96 CHEROKEE_TRACE="common,static,io_cache" /usr/bin/cherokee
97 CHEROKEE_TRACE="all" /usr/bin/cherokee
98 ----
9ceefc8 git-svn-id: svn://cherokee-project.com/cherokee/trunk@1767 5dc97367-9…
taher authored
99 +
100 By default the environment variable contains a list of comma
101 separated words, that point the server which parts and actions are
102 interesting for your trace. Besides, there are a few special cases:
103 +
e9b553f git-svn-id: svn://cherokee-project.com/cherokee/trunk@1721 5dc97367-9…
taher authored
104 - all: Activates all the trace points
105 - time: Prints the time at the beginning of the line
106 - thread: Prints the thread ID
107
4b220f2 @skinkie Dev aspelled
skinkie authored
108 * You can also access the functionality of CHEROKEE_TRACE through
e9b553f git-svn-id: svn://cherokee-project.com/cherokee/trunk@1721 5dc97367-9…
taher authored
109 `cherokee-tweak`. Refer to the apropriate section of the
110 documentation to learn more about this:
111 link:bundle_cherokee-tweak.html[cherokee-tweak].
112
1241fcd git-svn-id: svn://cherokee-project.com/cherokee/trunk@1740 5dc97367-9…
taher authored
113
e9b553f git-svn-id: svn://cherokee-project.com/cherokee/trunk@1721 5dc97367-9…
taher authored
114 * Lastly a utility is provided, `contrib/tracelor.py`, to provide
115 further help to these tracing abilities. It is a little script that
116 helps to read the tracing logs by colorizing the thread references
117 and highlighting the words passed through the command line.
9ceefc8 git-svn-id: svn://cherokee-project.com/cherokee/trunk@1767 5dc97367-9…
taher authored
118 +
119 An example of usage would be:
120 +
e9b553f git-svn-id: svn://cherokee-project.com/cherokee/trunk@1721 5dc97367-9…
taher authored
121 ----
122 CHEROKEE_TRACE=thread,all ./cherokee | ../contrib/tracelor.py iocache
123 ----
9ceefc8 git-svn-id: svn://cherokee-project.com/cherokee/trunk@1767 5dc97367-9…
taher authored
124 +
125 And it would yield an output such as the following. Even if it is
126 not terribly complicated, it is a handy script to trace the server more
127 easily.
1241fcd git-svn-id: svn://cherokee-project.com/cherokee/trunk@1740 5dc97367-9…
taher authored
128
9ceefc8 git-svn-id: svn://cherokee-project.com/cherokee/trunk@1767 5dc97367-9…
taher authored
129 image::media/images/tracelor.png[Output of tracelor.py]
Something went wrong with that request. Please try again.