Login | Register For Free | Help
Search for: (Advanced)

Mailing List Archive: Cherokee: dev

Issue 568 in cherokee: Optimizing redirects

 

 

Cherokee dev RSS feed   Index | Next | Previous | View Threaded


codesite-noreply at google

Sep 8, 2009, 7:28 AM

Post #1 of 7 (752 views)
Permalink
Issue 568 in cherokee: Optimizing redirects

Status: Accepted
Owner: alobbs
Labels: Type-Enhancement Priority-Medium OpSys-All Component-Logic
Performance

New issue 568 by ste...@konink.de: Optimizing redirects
http://code.google.com/p/cherokee/issues/detail?id=568

(04:20:11) drobbins: hiya
(04:23:17) drobbins: I think I found a way to optimize cherokee's
handling of redirects, if I am understanding my protocol dump correctly
(04:26:49) drobbins: it looks like cherokee closes the connection when
it returns a 301 to a client
(04:27:12) drobbins: however the client should be able to re-use this
connection, as the redirect may be to a file on the same site
(04:27:38) drobbins: say a user requests /doc/en/funtoo/about, cherokee
will redirect to /doc/en/funtoo/about/ (with trailing slash) and close
the connection.
(04:27:54) drobbins: the client then needs to initiate a new tcp/http
connection to request the redirected file.
(04:28:00) k001operator is weggegaan (quit: Remote closed the connection).
(04:28:13) drobbins: it seems like cherokee's handling of this could be
optimized.
(04:29:40) drobbins: of course I'm an HTTP protocol newbie so I could be
wrong
(05:11:21) Skinkie: drobbins: is this always true?
(05:11:26) Skinkie: also in the keepalive?

--
You received this message because you are listed in the owner
or CC fields of this issue, or because you starred this issue.
You may adjust your issue notification preferences at:
http://code.google.com/hosting/settings
_______________________________________________
Cherokee-dev mailing list
Cherokee-dev [at] lists
http://lists.octality.com/listinfo/cherokee-dev


codesite-noreply at google

Sep 10, 2009, 12:30 AM

Post #2 of 7 (711 views)
Permalink
Issue 568 in cherokee: Optimizing redirects [In reply to]

Comment #1 on issue 568 by alobbs: Optimizing redirects
http://code.google.com/p/cherokee/issues/detail?id=568

It's currently implemented in trunk. Here you have an example of three
Keep-Alive
requests (301, 404, and 200 responses):

=====================
$ curl -v http://localhost:1234/pcre http://localhost:1234/not_found
http://localhost:1234/list.h

* About to connect() to localhost port 1234 (#0)
* Trying 127.0.0.1... connected
* Connected to localhost (127.0.0.1) port 1234 (#0)
> GET /pcre HTTP/1.1
> User-Agent: curl/7.19.6 (i386-apple-darwin9.8.0) libcurl/7.19.6 zlib/1.2.3
> Host: localhost:1234
> Accept: */*

< HTTP/1.1 301 Moved Permanently
< Connection: Keep-Alive
< Keep-Alive: timeout=5
< Date: Thu, 10 Sep 2009 07:25:06 GMT
< Server: Cherokee/0.99.25b3650 (UNIX)
< Location: http://localhost:1234/pcre/
< Content-Length: 302
< Content-Type: text/html
< Cache-Control: no-cache
< Pragma: no-cache
<

* Connection #0 to host localhost left intact
* Re-using existing connection! (#0) with host localhost
* Connected to localhost (127.0.0.1) port 1234 (#0)

> GET /not_found HTTP/1.1
> User-Agent: curl/7.19.6 (i386-apple-darwin9.8.0) libcurl/7.19.6 zlib/1.2.3
> Host: localhost:1234
> Accept: */*

< HTTP/1.1 404 Not Found
< Connection: Keep-Alive
< Keep-Alive: timeout=5
< Date: Thu, 10 Sep 2009 07:25:06 GMT
< Server: Cherokee/0.99.25b3650 (UNIX)
< Content-Length: 274
< Content-Type: text/html
< Cache-Control: no-cache
< Pragma: no-cache
<

* Connection #0 to host localhost left intact
* Re-using existing connection! (#0) with host localhost
* Connected to localhost (127.0.0.1) port 1234 (#0)

> GET /list.h HTTP/1.1
> User-Agent: curl/7.19.6 (i386-apple-darwin9.8.0) libcurl/7.19.6 zlib/1.2.3
> Host: localhost:1234
> Accept: */*

< HTTP/1.1 200 OK
< Connection: Keep-Alive
< Keep-Alive: timeout=5
< Date: Thu, 10 Sep 2009 07:25:06 GMT
< Server: Cherokee/0.99.25b3650 (UNIX)
< ETag: 496f5682=f15
< Last-Modified: Thu, 15 Jan 2009 15:30:10 GMT
< Content-Length: 3861
=====================

Stefan, thanks for taking care of logging this report. :-)

--
You received this message because you are listed in the owner
or CC fields of this issue, or because you starred this issue.
You may adjust your issue notification preferences at:
http://code.google.com/hosting/settings
_______________________________________________
Cherokee-dev mailing list
Cherokee-dev [at] lists
http://lists.octality.com/listinfo/cherokee-dev


codesite-noreply at google

Jan 5, 2010, 8:41 AM

Post #3 of 7 (561 views)
Permalink
Re: Issue 568 in cherokee: Optimizing redirects [In reply to]

Updates:
Status: WaitingQA

Comment #2 on issue 568 by ste...@konink.de: Optimizing redirects
http://code.google.com/p/cherokee/issues/detail?id=568

We think that this is implemented, if not give a shoot.

--
You received this message because you are listed in the owner
or CC fields of this issue, or because you starred this issue.
You may adjust your issue notification preferences at:
http://code.google.com/hosting/settings
_______________________________________________
Cherokee-dev mailing list
Cherokee-dev [at] lists
http://lists.octality.com/listinfo/cherokee-dev


codesite-noreply at google

Jan 12, 2010, 4:28 PM

Post #4 of 7 (536 views)
Permalink
Re: Issue 568 in cherokee: Optimizing redirects [In reply to]

Comment #3 on issue 568 by skarcha: Optimizing redirects
http://code.google.com/p/cherokee/issues/detail?id=568

It is not implemented in all cases. When an handler error is set up while
Cherokee is
trying rules it fails.

This is because at that stage the
function "cherokee_connection_set_keepalive" has
not been called to set up Keep-alive.

======================
GET /trac/tractest1 HTTP/1.1
User-Agent: curl/7.19.5 (x86_64-pc-linux-gnu) libcurl/7.19.5 OpenSSL/0.9.8g
zlib/1.2.3.3 libidn/1.15
Host: mispruebas.tld:8008
Accept: */*

buffer.c:1113 ( cherokee_buffer_unescape_uri): Prev:
/trac/tractest1
vrule_wildcard.c:0098 ( match): VRule wildcard:
matched
'*mispruebas.tld'
server.c:1946 ( cherokee_server_get_vserver): Virtual server
'mispruebas.tld' matched vrule
thread.c:0929 ( process_active_connections): Setup connection
begins:
request="/trac/tractest1"
thread.c:0930 ( process_active_connections): Connection
0x22f1340 info
| Request: '/trac/tractest1' (15)
| Request Original: '' (0)
| Web Directory: '' (0)
| Local Directory: '' (0)
| Pathinfo: '' (0)
| User Dir: '' (0)
| Query string: '' (0)
| Host: 'mispruebas.tld' (14)
| Redirect: '' (0)
| Redirect num: 0
| Keepalive: 0
| Chunked-Encoding: 0
| Phase: Setup connection
| Range start: -1
| Range end: -1
| Rate: 0
| Option bits: log_at_end
\_
connection.c:1600 (cherokee_connection_build_local_directory): Set
Local
Directory: '/home/aperez/public_html/mispruebas.tld'
rule_list.c:0092 ( cherokee_rule_list_match): Trying rule
prio=500
rule_directory.c:0055 ( match): Match directory:
rule=/kk
req=/trac/tractest1: (str) ret_not_found
rule_list.c:0092 ( cherokee_rule_list_match): Trying rule
prio=400
rule_directory.c:0090 ( match): Had to redirect
to:
http://mispruebas.tld:8008/trac/tractest1/
connection.c:0406 (cherokee_connection_setup_error_handler): Setting
up error
handler: 301 (respins=0)
connection.c:0474 (cherokee_connection_setup_error_handler): Default
Error
handler set. Phase is 'init' now.
connection.c:0483 (cherokee_connection_setup_error_handler): New
handler error
thread.c:0603 ( process_active_connections): thread (0x22ccc00)
processing conn (0x22f1340), phase 7 'Init connection'
thread.c:0643 ( process_active_connections): conn (0x22f1340,
Init
connection): Timeout = now + 15 secs
thread.c:0689 ( process_active_connections): conn on phase
n=7: Init
connection
connection.c:2365 (cherokee_connection_open_request):
web_directory='/trac/tractest1' request='/trac/tractest1'
local_directory='/home/aperez/public_html/mispruebas.tld'
connection.c:0780 (cherokee_connection_build_header): Replying:
HTTP/1.1 301 Moved Permanently
Connection: close
Date: Wed, 13 Jan 2010 00:14:18 GMT
Server: Cherokee/0.99
Location: http://mispruebas.tld:8008/trac/tractest1/
Content-Length: 375
Content-Type: text/html
Cache-Control: no-cache
Pragma: no-cache
======================

Hope this helps ;)


--
You received this message because you are listed in the owner
or CC fields of this issue, or because you starred this issue.
You may adjust your issue notification preferences at:
http://code.google.com/hosting/settings
_______________________________________________
Cherokee-dev mailing list
Cherokee-dev [at] lists
http://lists.octality.com/listinfo/cherokee-dev


codesite-noreply at google

Jan 12, 2010, 4:37 PM

Post #5 of 7 (544 views)
Permalink
Re: Issue 568 in cherokee: Optimizing redirects [In reply to]

Updates:
Status: Accepted

Comment #4 on issue 568 by ste...@konink.de: Optimizing redirects
http://code.google.com/p/cherokee/issues/detail?id=568

Is this maybe the case why if any rule fails, the connection takes much
longer?

--
You received this message because you are listed in the owner
or CC fields of this issue, or because you starred this issue.
You may adjust your issue notification preferences at:
http://code.google.com/hosting/settings
_______________________________________________
Cherokee-dev mailing list
Cherokee-dev [at] lists
http://lists.octality.com/listinfo/cherokee-dev


cherokee at googlecode

Sep 16, 2011, 7:42 AM

Post #6 of 7 (115 views)
Permalink
Re: Issue 568 in cherokee: Optimizing redirects [In reply to]

Updates:
Status: Started

Comment #5 on issue 568 by alobbs: Optimizing redirects
http://code.google.com/p/cherokee/issues/detail?id=568

1.- Open a terminal and launch Cherokee. Eg: $ ./cherokee-worker -r . -p
1111

2.- Open another terminal an request something with a 301 response, for
instance, a directory without its trailing slash. Here is the result:

=======
> GET /zlib HTTP/1.1
> User-Agent: curl/7.21.7 (x86_64-apple-darwin10.8.0) libcurl/7.21.7
> OpenSSL/1.0.0d zlib/1.2.5 libidn/1.22
> Host: localhost:1111
> Accept: */*

< HTTP/1.1 301 Moved Permanently
< Date: Fri, 16 Sep 2011 14:28:20 GMT
< Server: Cherokee/1.2.99b6842 (UNIX)
< Location: http://localhost:1111/zlib/
< Content-Length: 374
< Content-Type: text/html
<
* Connection #0 to host localhost left intact
* Re-using existing connection! (#0) with host localhost
* Connected to localhost (127.0.0.1) port 1111 (#0)
> GET /zlib HTTP/1.1
> User-Agent: curl/7.21.7 (x86_64-apple-darwin10.8.0) libcurl/7.21.7
> OpenSSL/1.0.0d zlib/1.2.5 libidn/1.22
> Host: localhost:1111
> Accept: */*

< HTTP/1.1 301 Moved Permanently
< Date: Fri, 16 Sep 2011 14:28:20 GMT
< Server: Cherokee/1.2.99b6842 (UNIX)
< Location: http://localhost:1111/zlib/
< Content-Length: 374
< Content-Type: text/html
<
* Connection #0 to host localhost left intact
* Closing connection #0
=======

I'm not closing the report because there should be a QA test to cover this,
but besides that everything is working as expected.

_______________________________________________
Cherokee-dev mailing list
Cherokee-dev [at] lists
http://lists.octality.com/listinfo/cherokee-dev


cherokee at googlecode

Sep 16, 2011, 9:04 AM

Post #7 of 7 (114 views)
Permalink
Re: Issue 568 in cherokee: Optimizing redirects [In reply to]

Updates:
Status: Fixed

Comment #6 on issue 568 by alobbs: Optimizing redirects
http://code.google.com/p/cherokee/issues/detail?id=568

http://svn.cherokee-project.com/changeset/6857 added it.

_______________________________________________
Cherokee-dev mailing list
Cherokee-dev [at] lists
http://lists.octality.com/listinfo/cherokee-dev

Cherokee dev RSS feed   Index | Next | Previous | View Threaded
 
 


Interested in having your list archived? Contact Gossamer Threads
 
  Web Applications & Managed Hosting Powered by Gossamer Threads Inc.