Tag: programming

Subscribe to Feed of articles under programming

  1. "扩展 Linux ephemeral 端口限制"

    默认情况下,单一Linux能发起的客户端连接数是十分有限的,为此,我们要测试大规模连接程序时不得不启动很多客户端机器模拟连接。下面介绍一些增加单台Linux发起连接数的方法。

    增加文件打开数

    第一步最为基础的,提高打开文件描述符的数量。默认的情况下,这个配置为1024,是不能满足我们的使用的。增加到999999个:

    $ sudo ulimit -n 999999
    

    持久化这个配置,可以在/etc/security/(或/etc/security.d/,取决于你的发行版)下建立文件,增加

    *       hard    nofile      999999
    *       soft    nofile      999999
    

    这将对所有用户起效。

    增加客户端端口数

    当Linux发起客户端连接时,如果没有显式指定,会给客户端socket绑定一个 ephemeral 端口。这个端口的范围是从这个区间选取的:

     $ cat /proc/sys/net/ipv4/ip_local_port_range
    32768   61000
    

    如果这个区间的端口耗尽 …

  2. "Slacker Cluster 0.12: Grouping"

    What are Slacker and Slacker Cluster

    Slacker is my side project started in late 2011. The goal of Slacker project is to provide a high performance RPC system for clojure, with elegant API. Slacker doesn't ruin your code. Your remote invocation looks exactly same as local, from code. That means …

  3. "Fork-Join in Papaline"

    Papaline 0.3 introduced a new model "fork-join" for task execution. It allows you to split a task into smaller units, and execute them in parallel.

    Before that, a task is processed as a single unit from the first stage to the second, the third and the last. Within a …

  4. "Papaline: Concurrent pipeline with core.async"

    According to wikipedia, Staged Event-driven Architecture is an approach to software architecture that decomposes a complex, event-driven application into a set of stages connected by queues. We were using Java framework, stages, to implement queue based SEDA. As we are using more and more Clojure nowadays, I decide to re-implement …

  5. "Rust语言:安全的并发"

    本文原载于2014年3月《程序员》杂志编程语言专题。

    Rust 语言是近两年来 Mozilla 正在开发的一种新编程语言,它以并发,安全和实用为口号,主要使用场景是系统编程,用来取代C++语言的角色。有人戏称 Mozilla 由于大量使用 C++,深知其弊端,所以诞生了 Rust。目前,Rust 的两个主要产品是 Mozilla 下一代的浏览器布局引擎 Servo 和 Rust 编译器。由于语言在快速的开发和演进中,每个版本都会产生一些不兼容的变更,所以现在并非是学习这门语言细节并真正使用它的最佳时机。不过,这并不影响我们了解 Rust 语言:作为多年来鲜有的新系统编程语言,他本身有很多新颖之处,也可以帮助我们了解一些编程语言设计的流行趋势。

    并发

    和现在流行的很多新语言一样,Rust 在语言层面支持了绿色线程(Green threads):Task。Task 作为并发执行的单元,是用户空间的“线程”,创建和调度成本较低 …

  6. "slacker library updated"

    After almost two years idle in commit log, I restarted development of my slacker frameworks recently. It will be used in our AVOS Cloud production as integration solution between clojure systems.

    The recent update in slacker, slacker-cluster and link are:

    link

    There are two releases in the link library, features …

« Page 2 / 2