Web服务速度变慢 [英] Web Service slows down

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

问题描述

早上好,

我用VB.NET在Visual Web Developer Express中编写了一个Web服务.

它是一种扫描功能,可接收运输标签条形码并在找到时标记SQL数据库字段.如果找到,则Web服务功能将返回TRUE,否则返回FALSE.

它可以完美,快速地运行,但是在您扫描了大约五十个运输标签后,一切都会变慢.它似乎与Web服务有关,因为我使用与笔记本电脑相同的功能进行扫描,但未使用Web服务,因此该系统仍然运行良好.

如果我在浏览器中测试该Web服务,则在您输入序列号并调用该服务后,似乎每次都会返回一个新的结果页面,显示正确或错误的结果.最终会减慢速度吗?

有什么想法吗?

感谢

Good day,

I wrote a web-service in Visual Web Developer Express with VB.NET.

It is a scanning function that takes in a shipping label bar code and marks a SQL database field when found. If it is found the web-service function returns TRUE otherwise FALSE.

It works perfectly and quickly, but after you have scanned about fifty shipping labels, everything slows down. It seems to be related to the web-service as I use the same functions to scan with a laptop, but not employing web-services and that system still works perfectly.

If I test the web-service in a browser it seems to return a new result page every time, showing the true or false result, after you enter a serial number and invoke the service. Could this eventually slow it down?

Any ideas?

thanks

推荐答案

我要说的是,您应该始终使用SQL参数,而不是创建诸如"WHERE ShippingLabel ="之类的SQL语句. ScanndedShippingLabel& ""

使用SQL参数可防止您受到SQL注入攻击.
What I''m saying is you should always use SQL parameters instead of creating SQL statement such as "WHERE ShippingLabel=''" & ScanndedShippingLabel & "'' "

Using SQL parameters prevents you from SQL injection attacks.


使用SQL参数后您是否关闭了SQL读取器和连接?
您是否使用过DataSet,EF等?
您使用了什么SQL语句?

在我们对您的Web服务正在做的事情了解更多之前,我们可能无法说太多.但是您可以检查与SQL Server的连接数,Web服务上的内存使用情况等,这可能表明问题所在.
Did you close your SQL readers and connections after using it?
Did you use DataSets, EF and such?
What SQL statement did you use?

We probably can''t say much until we know more on what your web service is doing. But you can check the number of connections to your SQL server, your memory usage on the web service, etc that might indicate the issue.


因此,您好像没有关闭/在打开新连接之前,请正确处理连接.

PS:将您的ScannedShippingLabel和其他变量也移到SQL参数中.您将自己暴露于SQL注入.您没有理由不使用SQL参数或实现半n半的解决方案.
So it looked like you didn''t close/dispose the connection properly before opening a new one.

PS: Move your ScannedShippingLabel and other variables into SQL parameters as well. You are exposing yourself to SQL injection. There is no excuse for you not to use SQL parameters or to implement a half n half solution.


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

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