[ 
https://issues.apache.org/jira/browse/WICKET-5241?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13692866#comment-13692866
 ] 

Martijn Dashorst commented on WICKET-5241:
------------------------------------------

The issue is not that the requestlogger is reporting wrong figures, but rather 
that the detach phase is halting the response. When the request is in detach 
phase, no client side visible stuff should happen, including having a request 
stall for 10 seconds. To further aggravate the issue, onDetach is called twice 
in Wicket 6, making each request take twice as long as necessary:

I've crafted 4 quickstarts: 1.3.7, 1.4.22, 1.5.10 and 6.8.0, each running on 
8083, 8084, 8085 and 8086 respectively. Each HomePage class has been modified 
to include the following onDetach handler:

        @Override
        protected void onDetach() {
                super.onDetach();
                Duration.seconds(10).sleep();
        }


Wicket 1.3:
time curl http://localhost:8083 -o /dev/null -s

real    0m10.021s
user    0m0.009s
sys     0m0.007s

Wicket 1.4:

time curl http://localhost:8084 -o /dev/null -s

real    0m10.221s
user    0m0.008s
sys     0m0.006s

Wicket 1.5:

time curl http://localhost:8085 -o /dev/null -s

real    0m20.330s
user    0m0.007s
sys     0m0.007s

Wicket 6.8:

time curl http://localhost:8086 -o /dev/null -s

real    0m20.282s
user    0m0.008s
sys     0m0.007s

According to me this is completely wrong. There are two issues at hand:

1. the response is only written to the client after detach
2. since wicket 1.5 the detach is performed twice

1. is easily fixable by flushing the response prior to detaching, giving 
instant performance boosts to all users of Wicket

this doesn't fix the reported times by curl, but will enable browsers to start 
processing the markup (and close the connection on their end).

2. I don't know yet (haven't debugged that part)

                
> RequestLogger's server duration does not include 'detach duration'
> ------------------------------------------------------------------
>
>                 Key: WICKET-5241
>                 URL: https://issues.apache.org/jira/browse/WICKET-5241
>             Project: Wicket
>          Issue Type: Bug
>          Components: wicket
>    Affects Versions: 6.6.0
>            Reporter: Chris Gunnink
>            Priority: Minor
>              Labels: performance
>
> When a certain IModel impl takes a lot of time to detach, this will not be 
> included in the 'duration' section. This is very easy to reproduce: use a 
> model that sleeps for 10 seconds in the detach(); make sure to write a page 
> which will not much time to render, say 100ms. One will see that the 
> RequestLogger will output 100ms as duration, instead of 10100ms.
> In our production environment, these this server duration is the primary 
> metric to show server performance; so right now we're dealing with misleading 
> figures.
> I hope this is an easy one to fix ;-)

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

Reply via email to