Publisher time out and sometimes took hundreds of milliseconds for one single publish

53 views
Skip to first unread message

Bruce Liu

unread,
Apr 8, 2013, 5:13:48 AM4/8/13
to web...@googlegroups.com
Hi,
    We got this error in our production environment.
The stack trace from windows event log is:

<ExceptionType>System.Net.WebException, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</ExceptionType>
<Message>The operation has timed out</Message>
<StackTrace>
at FM.WebSync.Publisher.PerformPublish(Publication[] requestPublications)
at FM.WebSync.Publisher.Publish(Publication publication)
at [mynamespace].WebSync4Publisher.PublishEvent()


My code is:
        private static readonly string WebSyncServerUrl = ConfigurationManager.AppSettings["PublisherURL"];

        private static readonly Publisher publisher = new Publisher(WebSyncServerUrl);
       
        public void PublishEvent(short sourceId, short param1, byte param2, short param3, string jsonString)
        {
           
            var jsonEvent = new JsonEvent {EventId = eventId, JsonStr = jsonString};
            var jsonEventString = JsonConvert.SerializeObject(jsonEvent);
            var channel = string.Format("/S{0}S{1}M{2}", param1, param2, param3);

            logger.Info(string.Format("PublishEvent Channel {0}, eventId {1}", channel, eventId));
            publisher.Publish(channel, jsonEventString);
        }

Another issue is sometimes we found this single line taking 200 - 300 milliseconds when there is only one single message in the Publish() method.
publisher.Publish(channel, jsonEventString);

Did I do anything wrong?

Thanks.
Bruce


Jerod Venema

unread,
Apr 8, 2013, 8:20:33 AM4/8/13
to web...@googlegroups.com
Hey Bruce!

Make sure you've got your server set to allow multiple outgoing connections:


If you don't have that, you're going to run into difficulties if your publish speed exceeds your server's handling speed.

The flip side of that is on the receive side, ensure that you're not maxing out the number of IIS connections. We have a tuning app on our site (on the WebSync downloads page) that'll walk you through the settings, or you can check them manually here:

Best,


Bruce


--
You received this message because you are subscribed to the Google Groups "WebSync" group.
To unsubscribe from this group and stop receiving emails from it, send an email to websync+u...@googlegroups.com.
To post to this group, send email to web...@googlegroups.com.
Visit this group at http://groups.google.com/group/websync?hl=en.
To view this discussion on the web visit https://groups.google.com/d/msg/websync/-/3mEyVSLBsPMJ.
For more options, visit https://groups.google.com/groups/opt_out.
 
 



--
Jerod Venema
Frozen Mountain Software
919-300-5141 (United States)
604-227-2453 (Canada)
888-379-6686 (Extension 101)

george.n...@hotmail.com

unread,
Apr 19, 2013, 6:15:01 AM4/19/13
to web...@googlegroups.com
Jerod,

Can you please clarify on the issue of .NET applications are restricted to 2 simultaneous outgoing connections to a given domain at a time? I am not sure what this exactly means.
Furthermore, you propose to alleviate this issue by altering the web.config fron, like:

<?xml version="1.0" encoding="utf-8" ?>
<configuration>
  <system.net>
    <connectionManagement>
      <add address="*" maxconnection="12" />
    </connectionManagement>
  </system.net>  
</configuration>

Where should this alteration be effected. on the server side or the clients side?

Regards,

George

Jerod Venema

unread,
Apr 19, 2013, 9:21:50 AM4/19/13
to web...@googlegroups.com
Hey George!

.NET restricts *outgoing* requests to 2 by default. Where the config goes depends on what you're doing.

If you have a standard .NET application, communicating with IIS, then it goes in your app.config.

If you are creating a .NET WebSync client in IIS (for example, in a global context) or you're doing a lot of publishing from code-behind in your ASP.NET application, then you would add it to your web.config.

Best,

--
You received this message because you are subscribed to the Google Groups "WebSync" group.
To unsubscribe from this group and stop receiving emails from it, send an email to websync+u...@googlegroups.com.
To post to this group, send email to web...@googlegroups.com.
Visit this group at http://groups.google.com/group/websync?hl=en.
To view this discussion on the web visit https://groups.google.com/d/msg/websync/-/gHYL6WJ3LqAJ.

For more options, visit https://groups.google.com/groups/opt_out.
 
 
Reply all
Reply to author
Forward
0 new messages