3

Any recommendations for transition from single server to load balancing environment of 3 servers?

I considered using Sql Server session management, but I am storing linq2sql objects in session which has serialization issues. With a quick search I found a workaround .But I am skeptical to use this approach considering code-change/readability/performance issues. Any suggestions are welcome.

Syam
  • 1,629
  • 1
  • 20
  • 32
  • why are you storing linq2sql objects in 'session'? firstly, normally this should be held in cache, secondly, ideally you shouldnt be caching linq2sql objects - either project them into POCO's or into a generic collection (e.g List). If you're worried about serialization, then use ASP.NET State Service on a intermediary box - point all other servers to that (so the session is shared). but of course if that box goes down say goodbye to any current session. – RPM1984 Aug 02 '10 at 23:32
  • -These are user/form specific data before users commit them into DB -All objects are of type Collection. The relation between the objects still persists as they are passed between layers(cause of serialization issue) -I thought state service does serialization too. May be I am wrong – Syam Aug 02 '10 at 23:43
  • you're right, it does do serialization, just speaking from experience ive had troubles with sql state (sessions expiring for no reason). – RPM1984 Aug 03 '10 at 00:23
  • @RPM1984, agree with you. I Have had few scars my self with inproc as well – Syam Aug 03 '10 at 18:48

2 Answers2

3

Just a suggestion : Can't you use sticky sessions in your load balancer?

madaboutcode
  • 2,137
  • 1
  • 16
  • 23
  • I am using inproc until now. I don't know how to use sticky sessions in asp.net. Is there a way to access and modify the sessions in load balancer? – Syam Aug 02 '10 at 23:32
  • @Syam, This has to be configured at the loadbalancer. We are using this in production with three servers. Most hardware and s/w load balancers are able to do this. see.. http://en.wikipedia.org/wiki/Load_balancing_(computing)#Persistence – madaboutcode Aug 03 '10 at 00:17
  • I just confirmed with network team about the sticky sessions. This solves my issue. Thank a lot – Syam Aug 03 '10 at 18:36
2

We use memcached but it sounds like you want something to be a more critical portion of your app than just caching if you're placing LINQ to SQL objects up there (and I btw agree with RPM that you should consider getting out of that business...)

Anyway, this is a nice blog post that gives you a few options. Velocity is definitely one to look at since it's what Microsoft is offering (this is an asp.net app) and it seems to be gaining steam these days.

Tahbaza
  • 9,486
  • 2
  • 26
  • 39
  • I like this solution but my problem seems to be much simpler than that. @LightX suggested I use sticky sessions for this issue. Thanks a lot any way. As I mentioned, I am using colletion objects to store in the session. The relation between those tables are the once causing serialization pains – Syam Aug 03 '10 at 18:42