5

What I am doing

I am trying to migrate Classic Asp app to ASP.NET MVC. Classic App was written for 15 years. There are no chance to write new project and migrate all code at one moment. Business app must work 24/7.

What solutions I have found

I did not find any good solution. One advice I have found starts with words "I feel your pain, bro". Business can not give such human resources for global refactoring. So the only way I found is to write some kind of proxy using WebClient.

Architecture

I have server with IIS that hosts Classic ASP app. I will add MVC app near it. Every request received by server will be managed by MVC project. If there is action that request asks - MVC app will work as normal. Render view, return to client. If there is no such action Controller will call Classic ASP by using HandleUnknownAction method. So it will do some work by processing url and cookies and in the end call Classic Asp app by WebClient.DownloadString(). The return string (HTML response) it will embed as content to the page (Headers, Footers are in MVC Layout). Need to mention - project is not highlighted but near it. So I can migrate old code by small pieces. Action by action with no impact on application. Just by creating action methods in MVC.

Requirements

  1. Response time will grow significantly.
  2. There are no alternatives.

Question

I want to know every possible chance to speed up such web app. Maybe by tweaking WebClient configuration or so. Are there any settings to do this? Maybe some advices to manage webclient pool? I do not need to make cross server requests - does this open any abilities? Maybe this is the place for async calls? Or reorganize server structure?

Thanks for any advice!

Unihedron
  • 10,902
  • 13
  • 62
  • 72
Barada
  • 252
  • 2
  • 10
  • There's a chance this could get closed as "opinion based" but I think it's a decent one. – artm Nov 10 '14 at 08:17
  • I know rules. Yes. It is like "opinion based". But not. Advices can be tested, measured. So we can figure out **answer**, not opinion. – Barada Nov 10 '14 at 08:28
  • I agree. I was just saying there's a chance it could happen. – artm Nov 10 '14 at 08:29
  • Actually, IMHO the issue here is not that the question is opinion-based, but rather that it's simply too broad and, worse, does not include any code or a reasonably constrained question. There's no way to adequately answer the question in a manner suitable for this forum. – Peter Duniho Nov 10 '14 at 08:34
  • Code: `new WebClient().DownloadString(url);` All workflows are explained in topic – Barada Nov 10 '14 at 08:37
  • I will say it last time. I hate offtop comments. http://stackoverflow.com/questions/22342854/what-is-the-optimal-algorithm-for-the-game-2048 Find any difference to this question. Every question about optimization looks like this. Thanks. – Barada Nov 10 '14 at 08:50
  • If you have two services talking to each other in the same server I don't think it should REALLY slow things down. Are you using await on your webclient? – Moti Azu Nov 10 '14 at 09:02
  • @Barada You seem to be bit over defensive here, I up-voted your question and said it could be seen as "opinion based" by some. Peter said it could be "too broad", no one has voted to close it. No need for "I will say it last time. I hate offtop comments.". – artm Nov 10 '14 at 09:10
  • Excuse me @artm, Peter Duniho. I appreciate your help. Really. PS: offtop comments - it was about redirecting to 2048 question. – Barada Nov 10 '14 at 09:21
  • @mot . For sure it is good idea. Not yet implemented cause I think that I can get more benefits by configuring WebClient(do not know how). I only make requests for one app. So maybe I should not close connection to it? – Barada Nov 10 '14 at 09:28
  • I doubt that will help. If your calls are using async-await pattern then your new app won't be consuming any threads while waiting for response from the classic asp app, so that should save you a lot of performance/load issues. Besides that, the connection inside the same machine should be fast enough. – Moti Azu Nov 10 '14 at 09:31
  • @Barada Thanks for spotting that question about the 2048 game. I close voted it as too broad and yours as well. A good answer to your question require us to do performance messaurements and optimizations in your environment. You might find [this P&P article useful](http://msdn.microsoft.com/en-us/library/bb924375.aspx) or [this more pratical but retired content](http://msdn.microsoft.com/en-us/library/ff649152.aspx). Those links should help you to indentify the actual bottleneck. You can then edit this question with that info. – rene Nov 10 '14 at 09:49
  • @rene thanks for interesting links. I'll update post with measurements on 20.11.2014 in any case (Test server is not ready yet. Local tests results will be on 13.11.2014). I can not guess now where will be bottleneck, but for now i want figure out any suggestions about tweaking WebClient object in conditions of calls inside 1 server. Only mot suggested smth useful. – Barada Nov 10 '14 at 10:06
  • Don't guess, meassure. And then improve and meassure again. – rene Nov 10 '14 at 10:14
  • @rene As smart of an advice this is, more practical advice is useful. I don't want to send the dude to do it however and get mediocre results and maybe be satisfied or come back here, only for me to tell what I have foreseen all along. Use async operations and measure that. – Moti Azu Nov 10 '14 at 10:18
  • 1
    @mot how would async help if the database that needs to serve all those request is the bottleneck. Async might hurt in that case.... – rene Nov 10 '14 at 10:21
  • @rene Hey if that's the case then the classic app had it to begin with. We are talking about new problems that might occur when we proxy these requests. – Moti Azu Nov 10 '14 at 10:24
  • @mot sure, then I go back to my meassure/improve cycle. There is not much more practical advice then that. I would not start with async, just learn the basic perf-profile with plain calls. – rene Nov 10 '14 at 10:33
  • @rene There is no reason on earth that async will cause new troubles under the same load, it's just a matter of holding threads for it in the new app or not. the classic app will still face the same concurrency. – Moti Azu Nov 10 '14 at 10:35
  • Try it and we will know for sure.... – rene Nov 10 '14 at 10:37

0 Answers0