Since you think it's not network based how about using
http://developer.android.com/tools/debugging/debugging-tracing.html and
sprinkling trace output through the code to find the bottleneck?


On Fri, Feb 21, 2014 at 5:23 AM, Marco Serioli <[email protected]> wrote:

> Hi guys!
>
> I've already posted this question on Stack Overflow:
> http://stackoverflow.com/questions/21932685/httpurlconnection-slow-post-multipart-content
>
> But maybe here I can find more solution :)
>
>
> I'm trying to post a test File to a tomcat server using Android. I'm
> developing on Android 4.1.2, but I have verified same problem on 4.0.3.
>
> The problem is that the file upload requires a very long time (about 70
> seconds for a 4MB file), also in local network. The time is equiparable
> using a 3g connection. I've excluded that it could be a server problem:
> executing the same call with curl it takes 1 / 2 seconds.
>
> I'm using Spring Android RestClient 1.0.1.RELEASE and, given Android
> version and the fact that I'm not overriding default behaviour, it uses
> HttpUrlConnection instead of HttpClient to make http requests.
>
> I have also implemented my custom ClientHttpSessionFactory in order to
> manipulate some details of SSL connection and I have defined my own
> implementation of ClientHttpRequestInterceptor in order to modify
> authentication header.
>
> All works, also the posting of small file. But when I try to send "big"
> files the time increase.
>
> I have also set setBufferRequestBody(false) in order to avoid
> OutOfMemoryException on big files. But this property have no effects on
> time required.
>
> Looking in DDMS shell, on Network Statistics I've also found that the
> network throughput is never over 250kb in TX.
>
> There seems to be a bootleneck, but how to investigate it?
>
> I can post some code if it could be useful!
>
> Thank you for any suggestion!
> Marco
>
> --
> You received this message because you are subscribed to the Google
> Groups "Android Developers" group.
> To post to this group, send email to [email protected]
> To unsubscribe from this group, send email to
> [email protected]
> For more options, visit this group at
> http://groups.google.com/group/android-developers?hl=en
> ---
> You received this message because you are subscribed to the Google Groups
> "Android Developers" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> For more options, visit https://groups.google.com/groups/opt_out.
>

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Android Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to