【问题标题】:apache restlet connector overloadapache restlet 连接器过载
【发布时间】:2014-01-05 03:06:48
【问题描述】:

我在 from("restlet:http/myLink") 子句中的骆驼路线中使用 restlet。当用户的请求超过每秒十个时,我开始收到错误处理请求,例如“org.restlet.engine.connector.Controller run 信息:检测到连接器过载。停止接受新工作”

我认为,该错误是由线程数、请求查询的大小或数量或类似原因引起的。我尝试在 spring config 中设置为 maxThreads 参数不同的值

 <bean id="restlet" class="org.apache.camel.component.restlet.RestletComponent">
    <property name="maxThreads" value="15"/>
 </bean>

但我没有成功。在文档http://camel.apache.org/restlet.html 中,我找不到用于设置请求队列大小\数量的 ant 参数。我需要帮助:(

附: camel-restlet 版本是 2.12.2

更新

我尝试将大数字设置为 maxThreads,maxConnectionsPerHost,maxTotalConnections,但它没有用。如果像这样将 org.restlet.Component 注入骆驼的配置:

 <bean id="restletComponent" class="org.restlet.Component" />

<bean id="restlet" class="org.apache.camel.component.restlet.RestletComponent">
    <constructor-arg index="0">
        <ref bean="restletComponent" />
    </constructor-arg>
    <property name="maxThreads" value="255"/>
    <property name="maxConnectionsPerHost" value="1000"/>
    <property name="maxTotalConnections" value="1000" />
</bean>

如何覆盖使用 BaseHelper 参数的属性?

【问题讨论】:

    标签: threadpool apache-camel restlet-2.0


    【解决方案1】:

    经过lowThread的options后也是如此。 但是我发现当前发布的骆驼不支持it

    【讨论】:

    • 但是两个参数的默认值“-1”并不意味着“尽可能多地使用”?你能告诉我可以设置哪些选项来每秒处理 100 个请求吗?
    • 配置来自 Restlet(如您所见 github.com/apache/camel/blob/master/components/camel-restlet/… ),而不是来自 Camel/Camel 的组件。我找不到任何来自 Restlet 的文档来很好地列出和指定所有参数,只有 restlet.org/learn/javadocs/snapshot/jee/ext/org/restlet/ext/… ,但是这两个和线程数可以对吞吐量产生最大的影响。
    • 我刚刚检查了org.restlet.engine.connector.Controller的代码,信息日志意味着没有活动的工作线程供restlet使用。您可以在此处找到有关线程设置的更多配置。 restlet.org/learn/javadocs/2.1/jee/engine/org/restlet/engine/…
    • 我看到了 BaseHelper 的参数,尤其是 maxQueued,但是在骆驼的 RestletComponent 中该参数不存在。如何从非骆驼的休息区注入设置到骆驼的休息区?请在答案中提供示例代码。附言我更新了我的第一个问题。
    • 我们不提供camel中的maxQueued设置,所以我只是为它填写了一个JIRA。 issues.apache.org/jira/browse/CAMEL-7082
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2012-12-05
    • 1970-01-01
    • 1970-01-01
    • 2022-08-23
    • 2018-05-31
    • 2018-10-02
    • 1970-01-01
    相关资源
    最近更新 更多