BlazeDS first response is VERY SLOW
Hi everyone,
I have a very strange an annoying problem:
I have an appliaction written in Flex 3, with BlazeDS 3.2 and Java in the backend.
I'm actually using a portal (liferay) to display portlets that contain Flex movies.
When I hit a refresh button on my page, all the Flex movies send a RemoteObject request to the server (using BlazeDS), which should go to java classes and invoke a method (standard BlazeDS usage I 'm guessing).
I'm experiencing VERY slow response (14 minutes) on the first hit, while the following hits are much faster.
I've enabled the BlazeDS logging (logging level="All") and I also have debug prints coming from my java classes.
I also use the "showBusyCursor" attribute for the RemoteObject - so I can see indication of the request being sent from the flex movie.
Here is what I see:
- I hit the refresh button
- Each movie invokes a RemoteObject request
- I see a busy sign - in all the movies
- I see nothing in the log - no BlazeDS prints and no Java prints
- Wait 14 minutes or so
- I see BlazeDS prints followed by Java prints
- I see data populating my flex movies.
The really weird thing is that I have the same "application" installed in 4 different computers (on my laptop and in 3 other unix machines),
3 of these installations work well (good response times) and only 1 has the issue I'm describing.
I've tried many things, but everything failed.
I'd be really happy to get some advice on this.
Thanks,
Sivan

Comments
Hi.
Is the problematic computer a windows computer? (I understand the working ones are unix/linux)
Nadav
Hi Nadav,
The working envs are windows and unix, the non working env is a unix, I think it's a solaris..
Sivan
I don't know if I can really help, because I don't work with unix, but if it's the same code on every machine it sounds like an environmental issue.
Is tihe problematic machine on the same network as the others? maybe it uses a proxy? maybe it has specific routing settings somewhere?
Thanks for the reply.
I agree this looks like an environmental issue.
The different environments are at different customers.
I was thinking it might be a network or proxy issue - but I don't know what to check or research - so any ideas/directions will be great!
Sivan
Hi Sivan,
Where you able to resolve the issue? if yes, please state what the problem was and how did you manage to resolve it.
Do you have access to the JVM running the liferay portal? can you monitor it in real time while the requets are pending?
Do all JVMs have the same runtime parameters? can you share them here?
So actually I'm 99% sure I found the reason for this slowliness.
I've installed a network sniffer (Charles) and I saw that for every request the first connection tries to use my SSL channel, twice and only then go to use the non-ssl channel. I'm pretty sure the reason for that was that in the remoting-config.xml file I had the secure channel first in the channel list.
I've added code for every flash/flex file, where I would check the page URL, if it was HTTP I would dynamically choose the non-ssl channel, else - I would choose the ssl channel.
That seem to solve the problem :)
Hope that would help others!
Sivan