views:

222

answers:

5

I'm being told that the server we're being given to use has 2gb of ram but is nearly maxed out with the current main application that runs on it. But for the site were building, which is wholly reliant on a web service, we need to pass the response to the previous request within a chain... i.e.

Page One

var stepone = project.webservice.stepone("companyname","companyid"); //List Array Returned

Page Two

var steptwo = project.webservice.steptwo(stepone, otherargs);

As 'they' don't want us to store 'a lot' in the session, and were using ASP.net MVC C#, what other ways are there that would keep our memory footprint low but allow us to store what we need to for the users progression.

+1  A: 

Use TempData but implement the interface ITempDataProvider in your own provider that uses database or some such in lieu of sessions.

HTH,

Dan

Daniel Elliott
Upvoted: as someone voted it down, it seems like a viable option for a few of the scenarios in the process but in the case of the search results to avoid repeat requests were currently storing the results object in the session. Temp data gets lost after the second request for said data so doesn't seem too viable over all circumstances.
Chris M
as per >> http://msmvps.com/blogs/luisabreu/archive/2008/07/31/the-mvc-framework-the-tempdata-property.aspx
Chris M
We have decided on using a mix of TempData (which is technically 'from what i see' still using sessions) and normal Sessions. Using TD though ensures that once used the stuff we dont need is disposed of properly which is fine :o)
Chris M
+1  A: 

You can take a look at Velocity distibuted highly scalable in-memory cache from Microsoft. Check out this blog post from Stephen Walther.

Mehmet Aras
The only problem with Velocity that I have found so far is the CPU overhead, when attempting to push this to replace an Enterprise Cache implementation, our CPU cycles went through the roof. We ended up going with memcache instead not only is it a very proven bit of software, it is extremely fast.
Tom Anderson
Its apparently only in Tech-Preview, as a large company (who cant be arsed to give me the resource i need) They wont install anything that isn't already signed off; so I cant work outside of the basic programming set that comes with .net 3.5
Chris M
I definitely know that constraint, make use of the TempData structure then and then later when out of preview, you can replace your temprovider to use a distributed caching (if you need that kind of scalable cache).
Tom Anderson
Shoot IT with a large calibre gun and outsource to a supplier that understands web application development ;o) I'll definitely be looking at using it where I can get away with it, then hopefully either the problem will disappear or they'll give me an entire server rather then making me share space with a memory-hog.
Chris M
Have you reviewed how the application is currently using memory? Are things kept in memory longer than they needed? There could be some changes and optimizations that you can do to reduce the memory demand of the application and have some memory available for the other things. Those changes could be relatively easy, less costly, and more effective than introducing a different caching strategy and have it thorougly tested. Also, the type of caching (disk I/O or out-of-process such as a database) could have undesirable impact on performance as data gets serialized and deserialized.
Mehmet Aras
To my knowledge theres about 20 servers load balancing the same content, that content being the main sites and webservice.The project is a site to prove the web-service; so were being crowbarred into the current architecture. Are there any really good tools for testing?
Chris M
To answer my own question: http://dotnetperls.com/garbage-collection http://technet.microsoft.com/en-us/sysinternals/bb896653.aspx and http://msdn.microsoft.com/en-us/library/ms979205.aspx#scalenethowto13_topic2
Chris M
Thanks for the ideas :o)
Chris M
A: 

You might even have to drop MVC (maybe?) and go back to using basic webforms POST data and disable all eventstates. You can manage all the data you need via form variables and inputs on a page, as long as one page POSTs to the other, which would eliminate session.

A pain and costly to do, but you can do it. Just quote them the cost in man hours it would take to develop such a solution, and then contrast that with the cost of a decent server.

hova
4 Weeks to completely design,code debug, PEN and Load test... There's obviously many ways to skin a cat in ASP.net; MVC is fabulous and I don't plan on moving for what is essentially an IT created problem. The original spec was with them providing a custom server... hence grr
Chris M
A: 

Depending on the data, you could store it in cookies.

Noon Silk
Small string/int etc vars aren't so much the issue; its more result sets (listarrays 500 in size)
Chris M
* 4 KB per cookie maximum * 300 total cookies, for a total of 1.2 Mbytes maximum * 20 cookies accepted from a particular server or domain
Chris M
A: 

If you have a database server, then create temp tables to store your data as needed.

Tony Borf
Unfortunatley I have no storage available outside of the basic application; otherwise this would be a good option and also an optional choice for Sessions Storage rather then inproc
Chris M