none
Once again - slow WCF RRS feed

  • Question

  • Hi, I have a WCF-service and experiencing a delay while first launch. Excuse for this is that it's only firs time, next requests work quick enough. That's true. But...

    BUT #1
    To provide quick response by the following calls you need to set reliableSession enabled="True".

    BUT #1.1
    To do so, you need SSL-certificat which is cost money, and which is expensive for me as for single developer.

    BUT #1.2
    You have to keep connection and make sure this session is alive, which is expensive for the server in case of many users.

    If we ignore  reliableSession  then each request coast service-initialization time. All calls will be slow then.

    Here the question. Yes I do understand WCF need time to initialize my service. To start my function and send data back to the client. BUT! Why ASP.NET page with the same god demet function starts at one moment and provide quick reply? Is there any chance to make WCF-service as much responsive as ASP.NET page with no reliableSession?

    Thanks.


    Aleksey

    Friday, November 22, 2013 7:12 PM

All replies

  • HI 

    From your question it is not very clear that service response slow on every new session or when fist request from any user is received is

    Fist case   

        service response slow on every new session  please try configuring InstanceContextMode   

    Second case 

         Usually it happens when server is not in use for a long time and gets restarted , To solve this problem write a simple windows service on your server that will keep pinging the service after a particular interval , this will force your WCF service code to be always loaded in APP domain and client will get faster response

     Hope It Helps 

    Ashwini

    Saturday, November 23, 2013 1:34 AM
  • Hm... can't identify the case.

    My WCF-service with:
    <ServiceBehavior(InstanceContextMode:=InstanceContextMode.PerSession)>

    in web.config I have:
    <reliableSession enabled="True" inactivityTimeout="08:00:00"/>

    #1 case.

    Once I've started my client application it's opening service and it's take a time. Then I interact with service normally. I'm leaving application and close this service because it's the rule for session mode. Next time I'm start it I have same first time delay.

    #2 case.

    I'm starting client application and do not close it. Then I'm starting another client application and have same first start delay.


    Aleksey

    Saturday, November 23, 2013 2:05 PM
  • Ok

    It look like a design problem , does your service class is loading significant amount of data when started or making any network call etc.?This is most common reason for this kind of issues 

    Monday, November 25, 2013 6:49 PM
  • Em... no, it's not. While it's loading, as you understand, only authorization procedure starts. At this part I'm writing the shirt string to the log file and request for login and password in SQL Server database. This SQL is running for many clients (not only for me)... So, it's possible to assume there is a delay from the SQL... but it have no sense. It's could be so if this delay appear only once. But it's happens all times my clients connect to service. And it's not really big amount of clients to assume long database search (only about few hundreds).

    Aleksey

    Monday, November 25, 2013 7:42 PM