简体   繁体   中英

Performance issues with aspNetCompatibilityEnabled WCF service called from jQuery

I have a aspNetCompatibilityEnabled WCF service in my application.

I am making ajax calls like this (Finally a direct call to WCF service)-

        $.ajax({
            url: '~/WCFServices/MyService.svc/GetAllFoo',
            cache: false,
            contentType: 'application/json; charset=utf-8',
            data: {.............//Omitted/////// },
            dataType: 'json',
            type: 'GET',
            success: function (msg, status) {
                   .............//Omitted///////
            },
            error: function (xhr, status, err) {
                   .............//Omitted///////
            }
        });

Everything works fine with this approach. However, When I use this in production, and when there is high load, there are performance issues.

Using some tool, I found that /System.ServiceModel.Activation.ServiceHttpHandlerFactory+ServiceHttpHandler takes about 20 seconds.

I am not sure why this is so, and what could be done to improve the performance. Any help/pointer is greatly appreciated.

Additional Information- App is hosted on IIS 7.5

It seems that you host your application in IIS. aspNetCompatibilityEnabled is enabled to get benefits of IIS features for non http protocols like net.* .

There are several slow down issues such as IIS start up, first call to WCF service .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM