文章归档

tc:linux流量控制

http://lartc.org

1. Simple, classless Queueing Disciplines 1.1 pfifo_fast

This queue is, as the name says, First In, First Out, which means that no packet receives special treatment. At least, not quite. This queue has 3 so called ’bands’. Within each band, FIFO rules apply. However, as long as there are packets waiting in band 0, band 1 won’t be processed. Same goes for band 1 and band 2.

The kernel honors the so called Type of Service flag of packets, and takes care to insert ’minimum delay’ packets in band 0.

Do not

»» 继续阅读全文

libprocess并发编程

libprocess是mesos中非常重要的一个基础库,提供一些很方便的helper函数以及并发编程所需要的基本原语,例如下面我将重点讲的future/promise。

为了更好的解释future/promise是什么,我抽取了一段mesos中的代码作为例子:

Future<Socket> PollSocketImpl::accept() { return io::poll(get(), io::READ) .then(lambda::bind(&internal::accept, get())); }

这个函数的基本作用是:使用io::poll()注册io::READ事件,并且当事件ready的时候,调用internal::accept()。

显然,这是一个异步的accept()方法。

»» 继续阅读全文

mesos单机资源隔离

Mesos Containerizer简单介绍

http://mesos.apache.org/documentation/latest/mesos-containerizer/

mesos默认的容器目前支持四种资源隔离,共享文件系统、namespaces、cgroups、posix、网络端口隔离

»» 继续阅读全文

mesos: Segfault in net::getIP

今天把mesos升级到0.22.1之后slave一起来就core了,打开debug调试了一下:

Program terminated with signal 11, Segmentation fault. #0 0x00007f639867c77e in free () from /lib64/libc.so.6 (gdb) bt #0 0x00007f639867c77e in free () from /lib64/libc.so.6 #1 0x00007f63986c25d0 in freeaddrinfo () from /lib64/libc.so.6 #2 0x00007f6399deeafa in net::getIP (hostname="<redacted>", family=2)   at ./3rdparty/stout/include/stout/net.hpp:201 #3 0x00007f6399e1f273 in process::initialize (delegate=Unhandled dwarf    expression opcode 0xf3) at src/process.cpp:837 #4 0x000000000042342f in main ()

»» 继续阅读全文