asp.net mvc2로 작성된 웹 응용 프로그램이 있습니다. 현재 amazon cloud ec2에서 호스팅됩니다. 트래픽이 증가함에 따라 다중 인스턴스 환경을 원합니다. 현재 세션 시작 (글로벌 asax)에서 시작하는 사용자 지정 세션 클래스가 있고 응용 프로그램에서 getter 또는 setter 클래스를 통해 사용하고 있습니다. 멀티 인스턴스 잡일 때문에 구멍 보안 아키텍처를 처리해야합니다. 이 문제를 해결할 더 나은 방법을 찾고 있습니다.아마존 ec2에서 ASP.NET MVC 다중 인스턴스 세션 관리
protected void OnSessionStart()
{
HttpContext.Current.Session.Add("mySessionObject", new MyAppSession());
}
public static MyAppSession GetMySessionObject(HttpContextBase current)
{
if (current != null)
{
if (current.Session != null)
if (current.Session["mySessionObject"] == null)
{
current.Session.Add("mySessionObject", new MyAppSession());
}
}
if (current != null && current.Session != null)
return (MyAppSession) (current.Session["mySessionObject"]);
return null;
}
and so on.