You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cxf.apache.org by XyLus <ma...@gmail.com> on 2009/04/22 14:18:38 UTC

How to simulate service latency?

Hello All,

I'd like to simulate latency in my upload service  for test purpose ( I send
message using MTOM mechanism).

I have just added Thread.sleep(latency) to service implementation method
and everything works till I send small request. However when I send 20 MB
message then inovcation does not times out, even when server simulate 5
minutes latency and client has following configuration:

<http:conduit
		name="{http://x.y.z/uploader}UploadServicePort.http-conduit">

		<http:client AutoRedirect="true" ConnectionTimeout="10000"
			ReceiveTimeout="10000" AllowChunking="false" />

 </http:conduit>


One more thing I've been testing it on my localbox ( client and server are
hosted on the same box)

Please let me know what should be changed in order to get timeouts for BIG
message.
I hope it is not a bug in CXF itself.


Regards,
Maciej
-- 
View this message in context: http://www.nabble.com/How-to-simulate-service-latency--tp23175136p23175136.html
Sent from the cxf-user mailing list archive at Nabble.com.


Re: How to simulate service latency?

Posted by XyLus <ma...@gmail.com>.
Hi Dan,

Your hint was really  usefull! (I moved "sleep" after attachment consuming)
Now receive timeout works as it should.

Thanks,
Maciej


dkulp wrote:
> 
> 
> In your service, is the sleep before or after you "consume" the data from
> the 
> MTOM attachments?     That's actually an important distinction as the
> client 
> would be waiting in a different area.  
> 
> If it's before consuming the streams from the MTOM, then the client is 
> probably waiting on a write operation while streaming the data to the
> server.   
> Thus, the receive timeout wouldn't apply.    
> 
> Looking at URLConnection, I don't see any way to set a timeout on the
> write 
> side.   :-(
> 
> Basically, if the sleep occurs after you read in the entire stream of data
> for 
> the mtom attachments, then it SHOULD work as you want.
> 
> Dan
> 
> 
> 
> On Wed April 22 2009 8:18:38 am XyLus wrote:
>> Hello All,
>>
>> I'd like to simulate latency in my upload service  for test purpose ( I
>> send message using MTOM mechanism).
>>
>> I have just added Thread.sleep(latency) to service implementation method
>> and everything works till I send small request. However when I send 20 MB
>> message then inovcation does not times out, even when server simulate 5
>> minutes latency and client has following configuration:
>>
>> <http:conduit
>> 		name="{http://x.y.z/uploader}UploadServicePort.http-conduit">
>>
>> 		<http:client AutoRedirect="true" ConnectionTimeout="10000"
>> 			ReceiveTimeout="10000" AllowChunking="false" />
>>
>>  </http:conduit>
>>
>>
>> One more thing I've been testing it on my localbox ( client and server
>> are
>> hosted on the same box)
>>
>> Please let me know what should be changed in order to get timeouts for
>> BIG
>> message.
>> I hope it is not a bug in CXF itself.
>>
>>
>> Regards,
>> Maciej
> 
> -- 
> Daniel Kulp
> dkulp@apache.org
> http://www.dankulp.com/blog
> 
> 

-- 
View this message in context: http://www.nabble.com/How-to-simulate-service-latency--tp23175136p23251276.html
Sent from the cxf-user mailing list archive at Nabble.com.


Re: How to simulate service latency?

Posted by Daniel Kulp <dk...@apache.org>.
In your service, is the sleep before or after you "consume" the data from the 
MTOM attachments?     That's actually an important distinction as the client 
would be waiting in a different area.  

If it's before consuming the streams from the MTOM, then the client is 
probably waiting on a write operation while streaming the data to the server.   
Thus, the receive timeout wouldn't apply.    

Looking at URLConnection, I don't see any way to set a timeout on the write 
side.   :-(

Basically, if the sleep occurs after you read in the entire stream of data for 
the mtom attachments, then it SHOULD work as you want.

Dan



On Wed April 22 2009 8:18:38 am XyLus wrote:
> Hello All,
>
> I'd like to simulate latency in my upload service  for test purpose ( I
> send message using MTOM mechanism).
>
> I have just added Thread.sleep(latency) to service implementation method
> and everything works till I send small request. However when I send 20 MB
> message then inovcation does not times out, even when server simulate 5
> minutes latency and client has following configuration:
>
> <http:conduit
> 		name="{http://x.y.z/uploader}UploadServicePort.http-conduit">
>
> 		<http:client AutoRedirect="true" ConnectionTimeout="10000"
> 			ReceiveTimeout="10000" AllowChunking="false" />
>
>  </http:conduit>
>
>
> One more thing I've been testing it on my localbox ( client and server are
> hosted on the same box)
>
> Please let me know what should be changed in order to get timeouts for BIG
> message.
> I hope it is not a bug in CXF itself.
>
>
> Regards,
> Maciej

-- 
Daniel Kulp
dkulp@apache.org
http://www.dankulp.com/blog

Re: How to simulate service latency?

Posted by Glen Mazza <gl...@gmail.com>.
Hmmm.  What would a client connection timeout of just 10 do?  A receive
timeout of 10?  It would be good to shrink those values from the ones you
have below to confirm there indeed a bug, i.e., the client is indeed never
timing out.

Also, are you thinking of doing an async[1] web service?  Not that it's
fully relevant to your question, but it may be good to have it designed the
way it will finally be before doing this stress-testing.

HTH,
Glen

[1]
http://www.jroller.com/gmazza/entry/creating_service_side_asynchronous_web


XyLus wrote:
> 
> Hello All,
> 
> I'd like to simulate latency in my upload service  for test purpose ( I
> send message using MTOM mechanism).
> 
> I have just added Thread.sleep(latency) to service implementation method
> and everything works till I send small request. However when I send 20 MB
> message then inovcation does not times out, even when server simulate 5
> minutes latency and client has following configuration:
> 
> <http:conduit
> 		name="{http://x.y.z/uploader}UploadServicePort.http-conduit">
> 
> 		<http:client AutoRedirect="true" ConnectionTimeout="10000"
> 			ReceiveTimeout="10000" AllowChunking="false" />
> 
>  </http:conduit>
> 
> 
> One more thing I've been testing it on my localbox ( client and server are
> hosted on the same box)
> 
> Please let me know what should be changed in order to get timeouts for BIG
> message.
> I hope it is not a bug in CXF itself.
> 
> 
> Regards,
> Maciej
> 

-- 
View this message in context: http://www.nabble.com/How-to-simulate-service-latency--tp23175136p23175814.html
Sent from the cxf-user mailing list archive at Nabble.com.