WebApi 2 – RAM使用情况

我在共享主机上运行我的Web服务,它在应用程序池上提供高达100MB的RAM。
我的Web服务有大约12个控制器并使用异步entity framework+使用缓存: https : //github.com/filipw/AspNetWebApi-OutputCache

为了测试,服务响应非常少量的数据 – 例如,20个客户的列表,包括他们的地址和联系人数据,没有图像等。

启动(第一次请求)后,Web服务在另外几个请求后使用最多144MB RAM,大约250-350MB使用RAM – 比服务器回收我的服务。

这个数据量和控制器的RAM使用率是否正常? 或者是否存在优化问题?

我是WebApi的新手,我正在研究我的论文,但我尝试使用Entity Framework等对数据库进行异步访问。

编辑:我在服务器上设置32位模式后,RAM使用率约为100-130Mb,这比以前明显更好,但我仍然不确定它是否是好结果。

在这里,我包括我的控制器样本,以获取所有客户列表:

// READ ALL -GET // ROUTE /api/Customers/ [HttpGet] [CacheOutput(ClientTimeSpan = 30, ServerTimeSpan = 86400)] public async Task GetCustomers() { using (var db = new ApplicationDbContext()) { var customers = await db.Customers .Include(s => s.Address) .Include(s => s.Contact) .Include(s => s.Company).ToListAsync(); if (customers == null) return NotFound(); List viewCustomers = new List(); foreach (var c in customers) { CustomerViewModel customer = new CustomerViewModel{ Id = c.CustomerId, FirstName = c.FirstName, LastName = c.SureName, ICO = c.ICO, Notes = c.Notes, Street = c.Address.Street, Number = c.Address.Number, ZipCode = c.Address.ZipCode, City = c.Address.City, Country = c.Address.Country, MobileAreaCode = c.Contact.MobileAreaCode, MobileNumber = c.Contact.MobileNumber, Email = c.Contact.Email, TelephoneAreaCode = c.Contact.TelephoneAreaCode, TelephoneNumber = c.Contact.TelephoneNumber }; if (c.Company != null) customer.CompanyId = (int)c.CompanyId; else customer.CompanyId = -1; viewCustomers.Add(customer); } return Ok(viewCustomers); } }