Squid zph-qos 选项
来源:互联网 发布:金蝶软件数据恢复 编辑:程序博客网 时间:2024/05/23 20:36
squid默认并不是以root用户启动的进程,而且即使设置为以root用户启动也是无法生效的。
所以,如果想给socket打mark即调用setsockopt API函数的话需要权限来进行操作。
提权就很重要,libcap类库就是来干这个事情的。具体是在tools.cc文件中的函数实现restoreCapabilities 中CAP_NET_ADMIN就是提权的能力使能。
static voidrestoreCapabilities(bool keep){ /* NP: keep these two if-endif separate. Non-Linux work perfectly well without Linux syscap support. */#if USE_LIBCAP cap_t caps; if (keep) caps = cap_get_proc(); else caps = cap_init(); if (!caps) { Ip::Interceptor.StopTransparency("Can't get current capabilities"); } else { int ncaps = 0; int rc = 0; cap_value_t cap_list[10]; cap_list[ncaps] = CAP_NET_BIND_SERVICE; ++ncaps; if (Ip::Interceptor.TransparentActive() || Ip::Qos::TheConfig.isHitNfmarkActive() || Ip::Qos::TheConfig.isAclNfmarkActive() || Ip::Qos::TheConfig.isAclTosActive()) { cap_list[ncaps] = CAP_NET_ADMIN; ++ncaps; } cap_clear_flag(caps, CAP_EFFECTIVE); rc |= cap_set_flag(caps, CAP_EFFECTIVE, ncaps, cap_list, CAP_SET); rc |= cap_set_flag(caps, CAP_PERMITTED, ncaps, cap_list, CAP_SET); if (rc || cap_set_proc(caps) != 0) { Ip::Interceptor.StopTransparency("Error enabling needed capabilities."); } cap_free(caps); }#elif _SQUID_LINUX_ Ip::Interceptor.StopTransparency("Missing needed capability support.");#endif /* HAVE_SYS_CAPABILITY_H */}
zph 即Zero-Penalty Hit这个算法并不是真正意义上的Qos,而是基于命中的一种实现
Zero Penalty Hit created a patch to set QoS markers on outgoing traffic to clients.
Allows you to select a TOS/Diffserv value to mark local hits.
Allows you to select a TOS/Diffserv value to mark peer hits.
Allows you to selectively set only sibling or parent requests
Allows any HTTP response to clients will have the TOS value of the response coming from the remote server masked. For this to work correctly, you will need to patch your linux kernel with the TOS preserving ZPH patch. The kernel patch can be downloaded from http://zph.bratcheda.org
Allows you to mask certain bits in the TOS received from the remote server, before copying the value to the TOS send towards clients.
参考链接: http://wiki.squid-cache.org/Features/QualityOfService
- Squid zph-qos 选项
- squid 高级的选项
- squid配置选项分析
- squid透明相关选项的说明
- squid的配置文件的配置选项
- Squid中refresh_pattern选项的理解
- iunx的squid 命令行选项分类
- squid中行为状态与reload_into_ims选项
- QoS
- QoS
- QoS
- qos
- QoS
- QOS
- QOS
- QOS
- Squid
- squid
- 【搜索那些事】细谈lucene(一)初识全文资源检索框架lucene
- HTML5学习笔记-基础篇2-新元素概览
- ThinkPHP函数详解:U方法
- CodeForces 598A Tricky Sum 数列求和 暑期小练习Q
- 【搜索那些事】细谈lucene(二)lucene搜索程序组件详解
- Squid zph-qos 选项
- HTML <blockquote> 标签
- Linux学习之条件判断
- 正则表达式--非捕获
- 关于解决使用Ueditor时调用setContent()浏览器会报错问题
- 【搜索那些事】细谈lucene(三)lucene核心API简介
- NHOI2016的解题报告
- iOS开发中常用第三方库的整理
- leetcode 104 Maximum Depth of Binary Tree