简体   繁体   English

Padarn Opennetcf RESTful服务

[英]Padarn Opennetcf RESTful Services

Hi I'm evaluating Padarn for my project and I implemented a very simple RESTful example(POST & GET). 嗨,我正在为我的项目评估Padarn,我实现了一个非常简单的RESTful示例(POST&GET)。 I need Padarn for my WIN CE 5.0 or 6.0 web project and I bought a license. 我的WIN CE 5.0或6.0 Web项目需要Padarn,并且购买了许可证。 The RESTful service works well, but it's performance is not good enough. RESTful服务运行良好,但是性能不够好。 According to firebug results, every requests completed in 80ms (average) but after 10 requests it was completed in more than 120ms and its repetitive over (10~15) requests. 根据Firebug的结果,每个请求均在80毫秒(平均)内完成,但在10个请求之后,其均在120毫秒内完成,并且其重复次数超过(10〜15)个请求。 How can I improve performance and decrease response time? 如何提高性能并减少响应时间?

This is my web server config : 这是我的Web服务器配置:

<WebServer DefaultPort="80" MaxConnections="256" DocumentRoot="\NANDFlash\Inetpub\" Logging="false" UseSsl="false" >
<DefaultDocuments>
  <Document>index.html</Document>
</DefaultDocuments>

<httpHandlers>
  <assembly>WebAgent.dll</assembly>
  <add verb="POST" path="/mngmt" type="WebAgent.ManagmentHandler,WebAgent"/>
  <add verb="GET" path="/notif" type="WebAgent.NotifHandler,WebAgent"/>
</httpHandlers>

<VirtualDirectories />
<Cookies />
<Caching />
</WebServer>

And this is my handler class : 这是我的处理程序类:

namespace WebAgent
{
class ManagmentHandler : IHttpHandler
{
    public bool IsReusable
    {
        get { return true; }
    }

    public void ProcessRequest(HttpContext context)
    {
        context.Response.Write("OK");
        context.Response.Flush();
    }
}
}

I need to prepare response faster than 80ms. 我需要准备比80ms更快的响应。 The firebug shows details of response time and it's a kind of "waiting time" that related to server side code(RESTful service). Firebug显示了响应时间的详细信息,这是与服务器端代码(RESTful服务)有关的一种“等待时间”。

I would appreciate it if you help me. 如果您能帮助我,我将不胜感激。

I'm not certain there is much that can be done to improve the speed over what you already have done. 我不确定在提高速度方面已经可以做很多事情。 The path to handle this is pretty straightforward - Padarn is reusing an existing socket and reusing an existing handler class instance, so most of the time you see here is likely the time required to run the code (you've not said what sort of processor you're using) and to push the data out the network stack. 处理此问题的路径非常简单-Padarn正在重用现有的套接字并重用现有的处理程序类实例,因此,您在这里看到的大多数时间可能是运行代码所需的时间(您没有说过哪种处理器)您正在使用)并将数据推出网络堆栈。

Licensed builds perform slightly faster because the license check isn't done after the first pass, but I don't think it would gain you a 50% speed. 许可构建的性能稍快一些,因为在第一次通过之后就没有进行许可检查,但是我认为这不会使您获得50%的速度。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM