02-11-2010 03:41 PM
So I have an app that is sending push messages out to phones based on a particular input event. The messages are sent from a .NET service through an MDS-CS server running v4.1.7.16 to phones running a range of OS's (4.5+ though)
I'm seeing, pretty often, that the message delivery is delayed by anywhere from 10-60 seconds. I’ve narrowed down the issue and it appears that the slowdown is in the response time of the MDS server. I put some additional logging (on the .NET service side) in for pre-connect to the web server and post-send of message with messages that are under 8K – so the time to send should be a fraction of a second, and often it is.
What I’ve found is that messages aren’t sent until the MDS server responds to the HTTP request (makes sense – it can’t send a message I haven’t made a request for) – but that HTTP response takes anywhere from a fraction of a second to up to 30-60 seconds at times. It doesn’t appear to relate to message size or time of day or anything else I can find as a pattern on my side. It appears almost as if the server is throttling connections or just has times (usually this is about 50% of the time there is some significant delay) where the response is quite slow.
Are there any settings, maybe a throttling setting or a max concurrent HTTP connections setting that may be causing this?
Below are a couple of examples of the HTTP POST sent to the MDS-CS server and the response back:
TIME: [2/11/2010 2:34:52 PM]
SEVERITY: Debug
MESSAGE: ThreadId: 25 Sending message to http://uusnwa41.na.utcmail.com:8080/push?DESTINATION=30b18f3c&PORT=6363&REQUESTU
MESSAGE SENT:
<?xml version="1.0" encoding="utf-16"?><EventDetails xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns="http://www.xxx.com"> <EventTime>2010-02-11T14:34:52</EventTime> <E
and then the response 30 seconds later:
TIME: [2/11/2010 2:35:22 PM]
SEVERITY: Debug
MESSAGE: ThreadId: 25 Message sent successfully.
The code in between these two log messages is (s = a string containing the message data being sent)
Log.Dbg("Sending message to " + req.RequestUri.ToString() + ": " + s);
try
{
s2 = req.GetRequestStream();
s2.Write(bytes, 0, bytes.Length);
s2.Close();
}
catch { return false; }
finally
{
if (s2 != null)
{
s2.Close();
s2 = null;
}
}
Log.Dbg("Message sent successfully.");
The call to req.GetRequestStream() is what opens the connection to the MDS Server and that call is the one that hangs for up to a minute waiting on the MDS server to respond so I can POST the data.
Any thoughts on settings that may affect this response speed?
Thanks,
Justin
02-17-2010 10:12 AM
The first task is to narrow down where the delay is occurring.
Have you tried running the push application from a different machine/location? Have you tried running a different push application from that machine that runs your .NET push application? I recommend trying either the httppushdemo (requires a reliable port be configured on your BES) or the browserpushdemo included with the BlackBerry JDE and BlackBerry Java Plug-in for Eclipse. They can be found in the following directories:
.\Eclipse\plugins\net.rim.ejde.componentpack4.7.0_
or
C:\Program Files\Research In Motion\BlackBerry JDE 4.7.0\samples\com\rim\samples\server
Do you see any delay if you use an MDS-CS Simulator and BlackBerry Smartphone simulator running on both the same or different machine as the .NET push application?
Post the results of these tests. It should help t narrow down whether the delay occurs in the MDS-CS server, push application server or the push application itself. Once we have that figured out we can dig a bit deeper.