服务锁 [英] service lock

查看:59
本文介绍了服务锁的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



我们有一个在Web服务器上生成Windows服务的地图.我们的Web应用程序使用此Windows服务获取地图图像并生成给客户端.根据许可证,我们可以从该服务中获得2个地图服务器.当我对该Web应用程序进行压力测试时,Windows服务被锁定.我将近20个用户放置了10分钟,每1分钟增加了2个用户.在Web应用程序中,我们负责在消耗完地图服务器后将其释放.当我们进行缩放,平移等地图服务器用于每个动作时,我们将其释放.但是在压力测试下,我们获得了服务器线程中止异常,而在Web服务器上的Windows事件查看器中,我们获得了httprequest超时异常.因此,在再次进行10分钟的压力测试后,我们必须重新启动生成地图的Windows服务.如何解决?我试图让Windows服务在第一次失败,第二次失败之后重新启动,然后在Windows Service Recovery选项下重新启动.但是它不会重新启动.

问候

Vijay

解决方案

如果您收到停止服务的异常,请记录该异常,重置所有内容,然后从catch块重新启动服务.


我们过去使用的一个解决方案是拥有一个监视服务,该服务负责检查主服务是否运行良好.如果发现任何问题,它将重新启动主服务.在您的情况下,由于您不希望在轮询的基础上完成此操作,因此您可以让您的Web应用请求维护服务来重新启动主服务(如果它发现主服务已关闭).

Hi,

We have a map producing windows service on the web server. Our web application uses this windows service to get the map images and produce to the client. As per license we can have 2 map servers from this service. When I was stress testing this web application, the windows service was getting locked. I put near about 20 users for 10 minutes, 2 users ramp up at every 1 minute. In the web application we take care of releasing the map server after it has been consumed. When we do zoom, pan etc map server is used for each action we release it. But under the stress test, we get server thread abort exception and in the windows event viewer on the web server we get httprequest timed out exception. So after stress test of 10 minutes again we have to restart the map producing windows service. How can this be resolved? I tried to put the windows service to restart after 1st failure, 2nd failure and there after under the windows service recovery option. But it doesnt restart.

regards

Vijay

解决方案

If you get an exception that stops the service, log the exception, reset everything, and restart the service from the catch block.


One solution we''ve used in the past was to have a monitoring service that would be responsible to check that the main service is running fine. If it notices any issues, it restarts the main service. In your case since you don''t want this to be done on a polling basis, you could have your web-app request the maintenance service to restart the main service (if it finds that the main service is down).


这篇关于服务锁的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆