views:

50

answers:

1

For several months I've been working on a customer site building a web site using ASP.NET MVC with C#, SQL Server 2005, ADO.NET Entity Framework, JQuery and some ESRI web APIs and geodatabases. The test server is running IIS6 on Windows Server 2003. Over this time I've seen some weird things that have caused a lot of rework:

  1. JavaScript files on the client's servers will not recognize a normal relative path to scripts or URLs: instead of setting up a jqGrid with a url of '/Reports.mvc/GridData' I have to initialize it to <%= ResolveUrl("~/Reports.mvc/GridData") %> in a view, or capture the application path in the <head> tag of the master page:
    // Declare a variable to pass to jQuery functions that don't seem to 
    // handle URLs below the top-level pages on MVC in IIS6.
    var _applicationPath = new String('');
    // Reset the variable after jQuery document loaded event to make sure
    // every jQuery library and plugin sees the value.
    jQuery(document).ready(function() {
        _applicationPath = new String('');
    });
  1. I have tested the forms and the functions that post new data to the database and those that edit the data. On two development machines and on the server I am able to show that everything works. Yet, every time they test, the customer comes back and says this field or that field didn't save, or "displays funny."

At this point, the user's account is used only to log in to the web. My entity framework code is in a data DLL and works with the database through a single application user login. So there shouldn't be any problems with permissions or security.

The code doesn't change when someone logs in, the views don't change, and the database doesn't even know who logged in to the web site. So I've had to go back into the code time and again and just try to program even more defensively. But I reached the point a while ago that there was nothing left to do.

Yesterday the customer tells me that the server I've been using on their network is a virtual server. This is in an academic environment, and the server is in another building somewhere under the control of another department.

When first working on this test server, I was able to create an ASP.NET site, but most of the data controls prevented pages from loading, and other components in ASP.NET wouldn't work on the development system. That was why I switched to ASP.NET MVC.

We have moved to a physical test server I haven't worked with a virtual server before. Has anyone had any quirky experiences when working with virtual servers with ASP.NET or any of the other things?

+1  A: 

I don't trust virtual servers many of the available virtual servers available on the hosting market (especially low-cost ones with too limited resources and the promise of "flexible" additional resources) to host public web sites because the flexible allocation of resources often doesn't work for peak traffic, sometimes causing crashes and instabilities. What you're describing could come from a virtual server being equipped with too limited resources, or being run in an unstable or overburdened environment. It could, though, also be down to how the machine is set up, and how the web server is configured. (That path problem in 1. is definitely a configuration issue, I would say.)

You could try asking the people who run the thing to increase resources (processor time, RAM, Network traffic) for a while and see whether it gets any better. If it does, you'll have to see whether the increase can be made permanent, or a dedicated server used instead.

Pekka
Thanks for the response. We are moving to a dedicated server, but the IT department is non-responsive now (possibly due to workload and staff reductions), but the client was asking me to do some research about it. Your mention of configuration gives me something to go on.
Tim Rourke
Sorry Pekka, had to down vote this due to the subjective comment about virtualisation environments. Badly configured and tuned 'physical' servers are just as likely to cause headaches as badly configured virtual environments. I work for a web hosting company, we run ~60-70 VM's on a 7 node Xen based platform, we have a lot less issues than we do on physical servers. We also find reliability and flexibility has improved compared to running on physical servers. If it's done right then there shouldn't be problems.
Kev
@Kev, I agree in that I should maybe have made it clearer that the problems described are not an inherent characteristic of virtualization; still, I have set up a number of (low-cost) virtual servers with various providers, and they tend to react poorly especially to peaking load, I suspect because of the flexible resource allocation (guaranteed RAM X amount <> dynamically allocated RAM y amount) that low-cost providers use. Anyway, thanks for adding a comment to the vote, and I think we have covered both sides now :) In general, I think virtualization is a great technological advancement.
Pekka
I've edited my answer a bit to highlight more strongly that this is not a general problem with virtualization, but with what many providers offer in virtual servers these days.
Pekka
Un-downvoted :)
Kev

related questions