简体   繁体   English

使用Memcache向Apache的mod_proxy_balancer添加决策逻辑

[英]Adding decision logic to Apache's mod_proxy_balancer with Memcache

What I am trying to achieve is to have Apache's mod_proxy_balancer check if a request was already made using a Memcache store. 我想要实现的是让Apache的mod_proxy_balancer检查是否已经使用Memcache存储区发出了请求。

Basically: 基本上:
Streaming media request comes in. 流媒体请求进入。
Check if streaming media has already been served with Memcache. 检查流媒体是否已经与Memcache一起提供。
If so, can that streaming media server handle another request. 如果是这样,该流媒体服务器可以处理另一个请求。
If so send request to said streaming media server. 如果是这样,则向所述流媒体服务器发送请求。
If not send request to the next streaming media server in line. 如果没有,则将请求发送到下一个流媒体服务器。
Store key:value pair in Memcache. 将key:value对存储在Memcache中。

My questions are: 我的问题是:
Does mod_proxy_balancer already do this in some way? mod_proxy_balancer是否已经以某种方式执行此操作?
Is there anyway to make Apache a content-aware load balancer? 无论如何,可以使Apache成为可感知内容的负载平衡器吗?
Any other suggestions would be greatly appreciated too, other software, other approach, etc. 其他任何建议,其他软件,其他方法等也将不胜感激。

Cheers. 干杯。

Looking at 'mod_proxy_balancer.c'; 看'mod_proxy_balancer.c'; one could, as suggested in the comments in the file, add additional lbmethods. 可以按照文件注释中的建议添加其他lbmethod。 Something along the lines of "bymemcached_t" or "bymemcached_r" where the t and r endings denote the "bytraffic" and "byrequests" methods respectively. 沿着“ bymemcached_t”或“ bymemcached_r”的界线,其中t和r结尾分别表示“ bytraffic”和“ byrequests”方法。 We would do our pseudo code above and if not found proceed to the other methods and save the result in the memcached store. 我们将在上面执行伪代码,如果找不到伪代码,请继续执行其他方法,然后将结果保存在memcached存储中。

In my research I came across HAProxy which does exactly what I want from its documentation using the balance algorithm option of 'uri' just not using Memcached. 在我的研究中,我遇到了HAProxy,它使用'uri'的平衡算法选项完全按照其文档的要求工作,而没有使用Memcached。 Which is fine for my purposes. 这对我来说很好。

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

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