问题描述
上下文:我的公司一直在开发要由IIS托管的WebAPI应用程序,单个静态内容文件的请求等待时间约为60毫秒.我们研究了使用WebAPI Self主机对同一应用进行基准测试,并且同一内容文件的延迟约为15毫秒,这确实让我们大吃一惊.
Context: My company has been developing a WebAPI application to be hosted by IIS and the request latencies for a single static content file are about ~60ms. We investigated benchmarking the same app using WebAPI Self host and the latencies for the same content file were ~15ms, which really blew us away.
在部署过程中,我们喜欢IIS,因为IIS通过将DLL直接复制到我们的Web服务器上而为我们提供了极大的灵活性,从而使我们在进行热部署时无需做任何耗费时间的工作.
From a deployment process, we love IIS as it provides us extreme flexibility in doing hot deployments by copying DLLs directly to our web servers, which doesn't require us to do any sort of drain-stopping.
问题:使用自托管应用程序进行类似的热部署(仅通过dll复制)是否可行?
Question: Is it feasible to do similar hot deployments (just copying over dll's) with self hosted applications?
推荐答案
不,在执行自托管程序时,DLL将被锁定,因此您必须先停止自托管程序.您可以执行其他技巧,例如部署到另一个文件夹,然后重新路由请求等.但这与IIS部署不同.
Nope, while self-host is executing, the DLLs will be locked so you'll have to stop the self-host first. You can do other tricks like deploying to another folder and then re-routing requests etc. but it's not the same as IIS deployment.
这篇关于自助Web Api服务进行热部署的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!