You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@pivot.apache.org by pan peter <pa...@gmail.com> on 2011/10/14 13:58:13 UTC
pivot network performance
my application communicates with a tomcat server through a spring framework.
seems it has some strange behavior when my pivot client sends reqest to
server, server side applicatin takes less than 1 second to fetch data from
database, then it takes around 10 to 30 seconds for client to really get the
result, the result is a java list object. with the previous RCP client, it
takes only 1 second to fetch those data from server.
any suggestions? if i cannot resolve this performance problem, my pivot
client will be useless.
--
View this message in context: http://apache-pivot-users.399431.n3.nabble.com/pivot-network-performance-tp3421407p3421407.html
Sent from the Apache Pivot - Users mailing list archive at Nabble.com.
Re: pivot network performance
Posted by Sandro Martini <sa...@gmail.com>.
>> I'm using Java 6, pivot 2.0. I can see your demo runs quite quick for 100000
>> rows data, but where can i find the source code of the demo? Do I need to
>> change server side code to wrap <MyObject> to work with JSONSerializer?
>> Any example for that?
Ok, so the problem should be related to data transformation and/or
serialization ...
On JSON remember that only some data types can be converted to JSON
(this is the JSON standard), so pay attention to it, and you can use
Pivot Serializers or another library that generates JSON, it's up to
you.
If you need some example/tutorial etc, you can find all our latest
code under our trunk, here:
http://svn.apache.org/repos/asf/pivot/trunk/
(or if you prefer code from releases, even here:
http://svn.apache.org/repos/asf/pivot/tags/ )
Take a look at subprojects demos and demos-server (inside there is
RESTDemoServlet, interesting to see) there ... and maybe even under
examples.
Under tutorials could be useful "Web Queries" and "JSON-based table
view" for example, and you can see/try then even live from our site.
>If you want to try another remoting over http solution that works great with Pivot, take a look at >http://brap.tornado.no/. It's almost a dropin replacement for Spring HttpInvoker, as you would still program >against your interfaces the way you do now.
>
This is another option he could try, but FIRST we have to solve the
problem using the standard Pivot approach.
Tell us if you still have some problem, and when you solve it, how you
do it (it will be useful even to others) :-) .
Bye,
Sandro
Re: SV: pivot network performance
Posted by Sandro Martini <sa...@gmail.com>.
Hi,
> the funny thing is, if i run this app from another PC, then no problem at all. i guess the problem comes from my eclipse, which has lots of plugins installed.
>
> i install a clean eclispe in another folder, then create a project and copy the app there. now it takes no time to get all objects from server, i don't need to change any code at all :-)
>
Uh, very strange, but good to know ... sometimes i run eclipse with
the -clean parameter (so he can try to remove old plugins etc), and
delete all its old configurations (from eclipse help dialog and then
details or similar). But I agree with you, after some time it's better
to delete folder and any workspace metadata, and restart with a clean
eclipse and workspace, it's better.
So could be another option for you to use the latest helios sr1, a
great release.
But generally speaking this occurs not only with eclipse, for example
any time I have to update a VM (or a PC) with another version of the
OS I prefer to format and restart from scratch ...
> thanks for you guys :-)
No problem, the important is that the problem has been resolved :-) .
To the next ...
Bye,
Sandro
Re: SV: pivot network performance
Posted by pan peter <pa...@gmail.com>.
the funny thing is, if i run this app from another PC, then no problem at
all. i guess the problem comes from my eclipse, which has lots of plugins
installed.
i install a clean eclispe in another folder, then create a project and copy
the app there. now it takes no time to get all objects from server, i don't
need to change any code at all :-)
thanks for you guys :-)
--
View this message in context: http://apache-pivot-users.399431.n3.nabble.com/pivot-network-performance-tp3421407p3454002.html
Sent from the Apache Pivot - Users mailing list archive at Nabble.com.
Re: SV: pivot network performance
Posted by Sandro Martini <sa...@gmail.com>.
Hi, another suggestion:
you can try to use some library to convert (all server-side) your domain
objects to json, and return it to Pivot app ... latest Spring should have
something, or cxf, or other json library.
Sandro
Il giorno 18/ott/2011 16:58, "Sandro Martini" <sa...@gmail.com> ha
scritto:
> Ok, now at least we know where the problem is ...
> Take a look at this (old) article:
> http://java.sun.com/developer/technicalArticles/Programming/serialization/
> could give you some help.
>
> Maybe you could try to change the way Java serialize your classes,
> with some persistence delegate, or looking at custom serialization
> through java.io.Externalizable or through writeObject, readObject,
> writeReplace, readResolve or any other special serialization method.
>
> Your domain objects are linked directly to JPA or other persistence backend
> ?
> If yes, maybe you can transform your classes in a simpler (flat)
> hierarchy containing only "standard" types (Stringd and standard
> wrappers), and see if this helps (as should).
> Or transform any domain object (row) in a String [] or Serializable[]
> and see what happens.
>
> Debugging serialization issues is not-so-simple, I'm sorry.
> Could even be due to re-transmission of classes definitions.
>
> Note that if useful, you could even use Pivot BinarySerializer (
>
> http://pivot.apache.org/2.0/docs/api/org/apache/pivot/serialization/BinarySerializer.html
> ) to serialize 1 (attention: 1 and only 1) Serializable Object (or
> maybe put all your objects in a Collection and serialize it), but
> probably this could be useful after you have transformed your domain
> objects.
>
> Tell to us how you solve the problem ...
>
> Good luck,
> Sandro
>
>
> 2011/10/18 pan peter <pa...@gmail.com>:
> > just made that test, without any pivot code, simple java application
> makes
> > that service call, same time, 30 to 40 seconds.
> >
> > so it's not pivot issue.
> >
> > --
> > View this message in context:
> http://apache-pivot-users.399431.n3.nabble.com/pivot-network-performance-tp3421407p3431380.html
> > Sent from the Apache Pivot - Users mailing list archive at Nabble.com.
> >
>
Re: SV: pivot network performance
Posted by Sandro Martini <sa...@gmail.com>.
Ok, now at least we know where the problem is ...
Take a look at this (old) article:
http://java.sun.com/developer/technicalArticles/Programming/serialization/
could give you some help.
Maybe you could try to change the way Java serialize your classes,
with some persistence delegate, or looking at custom serialization
through java.io.Externalizable or through writeObject, readObject,
writeReplace, readResolve or any other special serialization method.
Your domain objects are linked directly to JPA or other persistence backend ?
If yes, maybe you can transform your classes in a simpler (flat)
hierarchy containing only "standard" types (Stringd and standard
wrappers), and see if this helps (as should).
Or transform any domain object (row) in a String [] or Serializable[]
and see what happens.
Debugging serialization issues is not-so-simple, I'm sorry.
Could even be due to re-transmission of classes definitions.
Note that if useful, you could even use Pivot BinarySerializer (
http://pivot.apache.org/2.0/docs/api/org/apache/pivot/serialization/BinarySerializer.html
) to serialize 1 (attention: 1 and only 1) Serializable Object (or
maybe put all your objects in a Collection and serialize it), but
probably this could be useful after you have transformed your domain
objects.
Tell to us how you solve the problem ...
Good luck,
Sandro
2011/10/18 pan peter <pa...@gmail.com>:
> just made that test, without any pivot code, simple java application makes
> that service call, same time, 30 to 40 seconds.
>
> so it's not pivot issue.
>
> --
> View this message in context: http://apache-pivot-users.399431.n3.nabble.com/pivot-network-performance-tp3421407p3431380.html
> Sent from the Apache Pivot - Users mailing list archive at Nabble.com.
>
Re: SV: pivot network performance
Posted by Edvin Syse <es...@syse.no>.
Thought so :) Try BRAP instead, you will be amazed :) hehe...
Sendt fra min HTC
----- Reply message -----
Fra: "pan peter" <pa...@gmail.com>
Til: "user@pivot.apache.org" <us...@pivot.apache.org>
Emne: SV: pivot network performance
Dato: tir., okt. 18, 2011 16:18
just made that test, without any pivot code, simple java application makes
that service call, same time, 30 to 40 seconds.
so it's not pivot issue.
--
View this message in context: http://apache-pivot-users.399431.n3.nabble.com/pivot-network-performance-tp3421407p3431380.html
Sent from the Apache Pivot - Users mailing list archive at Nabble.com.
Re: SV: pivot network performance
Posted by pan peter <pa...@gmail.com>.
just made that test, without any pivot code, simple java application makes
that service call, same time, 30 to 40 seconds.
so it's not pivot issue.
--
View this message in context: http://apache-pivot-users.399431.n3.nabble.com/pivot-network-performance-tp3421407p3431380.html
Sent from the Apache Pivot - Users mailing list archive at Nabble.com.
SV: pivot network performance
Posted by Edvin Syse <es...@syse.no>.
> got some progress. the problem has nothing to do with TCP delay or not. if
> server side returns a list of string, then client can get it immediately, but if it's
> a list of java object, in this case, my own object, pivot application takes long
> long time to deserialize the objects that server sent to client. as each of my
> object can contain some other objects as well.
Are you sure this is at all related to Pivot? Can you create a standalone app without Pivot on the classpath and see if you have the same problem there, or even better, post some code and set up a public service that we could try to call?
> in my previous eclipse client, serialize and deserialize object is handled by
> eclipse.
What do you mean by that?
-- Edvin
Re: pivot network performance
Posted by pan peter <pa...@gmail.com>.
got some progress. the problem has nothing to do with TCP delay or not. if
server side returns a list of string, then client can get it immediately,
but if it's a list of java object, in this case, my own object, pivot
application takes long long time to deserialize the objects that server sent
to client. as each of my object can contain some other objects as well.
in my previous eclipse client, serialize and deserialize object is handled
by eclipse.
any suggestions?
--
View this message in context: http://apache-pivot-users.399431.n3.nabble.com/pivot-network-performance-tp3421407p3431322.html
Sent from the Apache Pivot - Users mailing list archive at Nabble.com.
Re: pivot network performance
Posted by Roger Whitcomb <Ro...@rbwhitcomb.com>.
Can you do any kind of profiling to see exactly where in the code is
taking all the time? That would help to know what to suggest changing
to improve performance.
Sent from my iPhone
On Oct 14, 2011, at 8:08 AM, pan peter <pa...@gmail.com> wrote:
> i have set tomcat Connector with
> tcpNoDelay="true"
> but seems no change on the performance. i'm using the service call
> to get
> data from server, not through socket read, that cannot be changed,
> so i
> cannot make bufferred read to get the data.
>
>
>
> --
> View this message in context: http://apache-pivot-users.399431.n3.nabble.com/pivot-network-performance-tp3421407p3421972.html
> Sent from the Apache Pivot - Users mailing list archive at Nabble.com.
>
Re: pivot network performance
Posted by pan peter <pa...@gmail.com>.
i have set tomcat Connector with
tcpNoDelay="true"
but seems no change on the performance. i'm using the service call to get
data from server, not through socket read, that cannot be changed, so i
cannot make bufferred read to get the data.
--
View this message in context: http://apache-pivot-users.399431.n3.nabble.com/pivot-network-performance-tp3421407p3421972.html
Sent from the Apache Pivot - Users mailing list archive at Nabble.com.
Re: pivot network performance
Posted by Roger Whitcomb <Ro...@rbwhitcomb.com>.
We had some similar performance problems that were easily solved by
setting tcpnodelay on the socket and using a buffered stream to read
the data from the socket.
So, maybe try that if you are not doing it already.
~Roger Whitcomb
Sent from my iPhone
On Oct 14, 2011, at 4:58 AM, pan peter <pa...@gmail.com> wrote:
> my application communicates with a tomcat server through a spring
> framework.
> seems it has some strange behavior when my pivot client sends reqest
> to
> server, server side applicatin takes less than 1 second to fetch
> data from
> database, then it takes around 10 to 30 seconds for client to really
> get the
> result, the result is a java list object. with the previous RCP
> client, it
> takes only 1 second to fetch those data from server.
>
> any suggestions? if i cannot resolve this performance problem, my
> pivot
> client will be useless.
>
> --
> View this message in context: http://apache-pivot-users.399431.n3.nabble.com/pivot-network-performance-tp3421407p3421407.html
> Sent from the Apache Pivot - Users mailing list archive at Nabble.com.
>
SV: pivot network performance
Posted by Edvin Syse <es...@syse.no>.
> my client communicates with server through https request, with a serice call
> like
>
> List<MyObject> objects = myservice.getAllObjects();
> I'm using Java 6, pivot 2.0. I can see your demo runs quite quick for 100000
> rows data, but where can i find the source code of the demo? Do I need to
> change server side code to wrap <MyObject> to work with JSONSerializer?
> Any example for that?
If you want to try another remoting over http solution that works great with Pivot, take a look at http://brap.tornado.no/. It's almost a dropin replacement for Spring HttpInvoker, as you would still program against your interfaces the way you do now.
-- Edvin
Re: pivot network performance
Posted by pan peter <pa...@gmail.com>.
thanks a lot for reply.
my client communicates with server through https request, with a serice call
like
List<MyObject> objects = myservice.getAllObjects();
I can debug the server code, and i can see it takes no time for server
prepare the list to client. But seems it takes time for client, in this
case, my pivot applcation, run from Eclipse as a Java application, to fetch
the result from server. If it's a list of 500 strings, then it takes a
couple of seonds, if it's a list of MyObject, then it takes more than 10
seconds, for complicate objects, it can take 30 to 60 seconds. And those
operations in my old RCP client takes no time.
I'm using Java 6, pivot 2.0. I can see your demo runs quite quick for 100000
rows data, but where can i find the source code of the demo? Do I need to
change server side code to wrap <MyObject> to work with JSONSerializer? Any
example for that?
--
View this message in context: http://apache-pivot-users.399431.n3.nabble.com/pivot-network-performance-tp3421407p3421788.html
Sent from the Apache Pivot - Users mailing list archive at Nabble.com.
Re: pivot network performance
Posted by Sandro Martini <sa...@gmail.com>.
Hi,
for sure 10 to 30 seconds for response time are not acceptable ... so
we have to see where is the problem.
Have you never tried our "Large Data Sets" Demo from here (
http://pivot.apache.org/demos/large-data.html ) ?
There we download many rows of data, in few time.
Are you running your application as standalone, or via Web Start or an Applet ?
What Platform (Windows XP, etc) and Java version (important, a lot),
and Pivot verison (2.0 , or current trunk, or other) ?
How do you communicate with your server side webapp ?
You say Spring, but what version, and how (remoting, http, etc) ?
The simpler way could be to exchange data via JSON, using Pivot
JSONSerializer and related classes. Or another of directly supported
formats inside Pivot, otherwise you'll have to handle/transform data.
And last, you say that the result currently is a java list object, are
you sure that even the transformation part from here (to Pivot data
structures) doesnt' take too much time (just to be sure) ?
Tell me.
Bye,
Sandro