Creating high performance WCF services - Scott Weinstein on .Net I had a WCF service where I wanted to be able to support over a hundred concurrent users, and while most of the service methods had small payloads which returned quickly, the startup sequence needed to pull down 200,000 records. The out of the box WCF service had no ability to support this scenario, but with some effort I was able to squeeze orders of magnitude performance increases out of the service and hit the performance goal. Initially performance was abysmal and there was talk of ditching WCF entirely ( and as the one pushing WCF technology on the project this didn't seem like a career enhancing change ) Here's how performance was optimized. Use NetTCP binding This helps both throughput and the time it takes to open and close connectionsUse DataContract Serializer instead of XMLSerializerI started out using DataTables - POCO objects via Linq2Sql yielded a 6x increaseslow: [OperationContract] MyDataTable GetData(...) [OperationContract] Byte[] GetData( and the implementation to
Facebook Application Development | Facebook Pages | Facebook Connect Dan Rigsby » How to throttle a Wcf service, help prevent DoS attacks, and maintain Wcf scalability What can you do to prevent denial of service (DoS) attacks on your Wcf services? A DoS attack occurs when a flood of client requests come into a service and prevent legitimate requests from being made or slow down intended processing. At the same time, you need to be careful not to stranglehold legitimate requests and activity. Throttling Throttling is one mechanism that can be used to help mitigate the load from a DoS attack. Wcf handles throttling through the ServiceThrottlingBehavior class. or through the app.config: There are 3 properties supported on the ServiceThrottlingBehavior: MaxConcurrentCalls (default = 16) [Per-message] The maximum number of messages that can actively be processed. "The open operation did not complete within the allotted timeout of 00:00:59.9989999. You could set all the these values to Int32.Max. Recommendations: If your InstanceContext is set to "PerSession" you should set maxConcurrentCalls to be at least 25-30. Quotas
Facebook.NET GetType and TypeOf confusion - Joacim's view on stuff Both VB and C# have an operator called TypeOf (or typeof in C#) but they perform two completely different things. In VB there are also two kind of GetType() calls, the object.GetType() method which is part of the .Net framework and the VB language specific GetType() operator. Are you confused yet? Don’t worry, in this article I will try to explain the difference between these operators and the object.GetType() method. The TypeOf, typeof, GetType operators The VB TypeOf operator is used together with the Is keyword and is used for checking if an object is of a particular type. result = TypeOf x Is String If “x” above is a string then “result” would be True otherwise it is set to False. result = x is string; The typeof operator in C# on the other hand returns an instance of the System.Type class containing type declarations of the type you pass to it. Type t = typeof(string); The VB equivalent of the C# typeof operator is the GetType operator. Dim t As Type = GetType(String) Have fun!
How to Develop a Hit Facebook App: 29 Essential Tools and Tutorials - Software Developer Resources to help you build a successful Facebook app that users will love. Software Developer Editors "Wanted: Facebook App Developer" is one of the most popular programmer job-board postings of 2007. Seemingly everyone is trying to capitalize on the popularity of Facebook by developing their own integrated application in the hopes that it will go viral. Unfortunately, however, there still isn't a lot of good information available as to how to actually create a working Facebook app, not to mention a popular one. Related Articles: Introductory Links: The Basics Although Facebook's developer resources won't provide you with the depth of information needed to build something remarkable, it should be every new Facebook developer's first stop. 1. 2. 3. 4. 5. Tricks of the Trade Having covered the basics of Facebook app development and integration, you'll want to start creating more complex applications and achieving more seamless integration. 8. 9. 10. 12. Code Samples, Discussion and Forums
elmah - Error Logging Modules and Handlers for ASP.NET ELMAH (Error Logging Modules and Handlers) is an application-wide error logging facility that is completely pluggable. It can be dynamically added to a running ASP.NET web application, or even all ASP.NET web applications on a machine, without any need for re-compilation or re-deployment. Once ELMAH has been dropped into a running web application and configured appropriately, you get the following facilities without changing a single line of your code: Logging of nearly all unhandled exceptions. A web page to remotely view the entire log of recoded exceptions. ELMAH 1.2 Service Pack (SP) 2 now available for download. More Features Log errors to several back-end storages: Supports ASP.NET 1.x, 2.0 and later versions. ELMAH in Action Following is a screenshot of Firefox displaying the error log page as provided by ELMAH: To learn more about ELMAH, see the MSDN article “Using HTTP Modules and Handlers to Create Pluggable ASP.NET Components” by Scott Mitchell and Atif Aziz.
Fun With WebMatrix Helpers in ASP.NET MVC 3 « .NET Web stuff, mostly. It’s nearly the weekend, and it’s been long week, so let’s have a bit of fun… So I take it you’ve all had a chance to look at WebMatrix? If you haven’t then you should really make the effort to have a play around with it. I will admit that I was a bit snobby about it when I first read about it, but it is actually a really great way to build small, simple web sites. For the uninitiated, here are a few useful links: You can install WebMatrix through the Web Platform Installer. Well, WebMatrix is built on ASP.NET, so it is actually a trivial task to add them to an ASP.NET MVC application. Getting Going There are loads of helpers available, today we are going to look at the Microsoft Web Helpers. Install-Package microsoft-web-helpers into the the Package Manager Console. Next you will need to add references to WebMatrix.Data and WebMatrix.WebData and set the “Copy Local” property to true for both of them. And that’s it! Gravatar @Gravatar.GetHtml("stevelydford@gmail.com") XBox Live GamerCard