规范 https://www.w3.org/TR/webrtc/
http://www.whatsmyip.org/traceroute/
curl “http://myexternalip.com/raw"
https://github.com/coturn/coturn/wiki/turnserver
nack来完成 bufferbloat tinyfec tinyfecV×N
Good turnServer 消息验证过程 https://www.ietf.org/proceedings/87/slides/slides-87-behave-10.pdf
同道中人 http://blog.51yip.com/server/1946.html
ALTERNATE-SERVER
部署stun和turn服务器 https://blog.csdn.net/wojiaopanpan/article/details/50698184
http://www.cnblogs.com/lingdhox/p/4209659.html
webrtc文章多 http://www.voidcn.com/article/p-qbnbtolt-bgc.html
http://blog.51cto.com/13323775/2061637
daydayupCOTURN服务器使用 https://blog.csdn.net/day_day_up1991/article/details/52253892
Good STUN和TURN技术浅析 http://www.h3c.com.cn/MiniSite/Technology_Circle/Net_Reptile/The_Five/Home/Catalog/201206/747038_97665_0.htm
自己动手搭建 WebRTC TURN&STUN 服务器 https://www.pressc.cn/967.html
Free file sharing tool! 参考 https://droplr.com/lite/

百万TCP连接要点

关于文件描述符

Q: too many files open
A: ulimit –SHn 1048576

关于内核模块nf_conntrack

Q: dmesg: table full, dropping packet
A: # sysctl -w net.netfilter.nf_conntrack_max=1048576

[TOC]

以太坊虚拟机

概述

以太坊虚拟机 EVM 是智能合约的运行环境。它不仅是沙盒封装的,而且是完全隔离的,也就是说在 EVM 中运行代码是无法访问网络、文件系统和其他进程的。甚至智能合约之间的访问也是受限的。

账户

以太坊中有两类账户(它们共用同一个地址空间): 外部账户 由公钥-私钥对(也就是人)控制; 合约账户 由和账户一起存储的代码控制.

epoll api 和poll执行一个相似的任务:监控多个文件描述符来检测它们之中是否有I/O可用。epoll可用于 edge-triggered 或者 level-triggered 并且 监测大规模的文件描述符时具有良好的伸缩性。

edge-triggered mode delivers event only when changes occur on the monitored file descriptor.

unexpected extra pollout events from epoll

Date Sun, 26 Oct 2008 15:07:24 -0700 (PDT)
From Davide Libenzi <>
Subject Re: unexpected extra pollout events from epoll
share 0
share 0
On Sun, 26 Oct 2008, Paul P wrote:

I am programming a server using the epoll interface and have the receive portion of the server working fine, but for some reason as I implement the send portion, I noticed a few things that seem like strange behaviors in the implementation of epoll in the kernel.

I’m running Opensuse 11 and it has a 2.6.25 kernel.

The behavior that I can seeing is when I do a full read on an edge
triggered fd, for some reason, it seems to be triggering an epollout
event after each loop of the read events on a socket. (before I’ve done
any writes at all to the socket)

This is very strange behavior as I would expect that the epollout event
would only be triggered if I did a write and the socket recieved an ack
which cleared out the send buffer.

The documentation on epollout is really sparse, so any help at all from
the list would be very much appreciated. Do I need to manually arm the
epollout flag after a write? I thought this was only necessary for
level triggered epoll.

The way epoll works, is by hooking into the existing kernel poll
subsystem. It hooks into the poll wakeups, via callback, and it that way
it knows that “something” is changed. Then it reads the status of a file
via f_op->poll() to know the status.
What happens is that, if you listen for EPOLLIN|EPOLLOUT, when a packet
arrives the callback hook is hit, and the file is put into a maybe-ready
list. Maybe-ready because at the time of the callback, epoll has no clue
of what happened.
After that, via epoll_wait(), f_op->poll() is called to get the status of
the file, and since POLLIN|POLLOUT is returned (and since you’re listening
for EPOLLIN|EPOLLOUT), that gets reported back to you.
The POLLOUT event, by meaning a buffer-full->buffer-avail transition, did
not really happen, but since POLLOUT is true, that gets reported back too.
This, again, since epoll has no clue of what happened at callback hit time.
I’m working on changes that will make epoll aware (by using the existing
support for the “key” parameter of wakeups) of events at callback time,
but this is something that is still up for discussion and definitely won’t
be in .28.
The best way to do it ATM, is to wait for POLLOUT only when really needed.

Davide

age count
NULL 3
-1 14412
15- 7
16-25 8797
26-35 46570
36-45 30336
46-55 3325
56+ 1871

+————+——-+

sed

sed 主要是以行为单位进行处理,将数据行进行替换、删除、新增、选取等操作。命令格式:
sed [-nefri] 'command' 文本或文件名

general query log

How and When To Enable MySQL Logs
How to enable MySQL logging?

The general query log is a general record of what mysqld is doing. The server writes information to this log when clients connect or disconnect, and it logs each SQL statement received from clients. The general query log can be very useful when you suspect an error in a client and want to know exactly what the client sent to mysqld.

TCP congestion control

tcp_get_info /include/net/tcp.c

jiffies

jiffies holds the number of times the system timer has popped since the system booted. The kernelincrements the jiffies variable, HZ times every second. Thus, on a kernel with a HZ value of 100, a jiffy is a10-millisecond duration, whereas on a kernel with HZ set to 1000, a jiffy is only 1-millisecond long.
To better understand HZ and jiffies, consider the following code snippet from the IDE driver(drivers/ide/ide.c) that polls disk drives for busy status:
unsigned long timeout = jiffies + (3HZ);
while (hwgroup->busy) {
/
/
if (time_after(jiffies, timeout)) {
return -EBUSY;
}
/
… */}
return SUCCESS;