Erlang 池管理 maestro Erlang

码农软件 · 软件分类 · 常用工具包 · 2019-08-15 22:43:34

软件介绍

maestro 是 Erlang 池管理程序。

为什么?

短暂 I/O 任务(比如数据库访问)的大型 worker 池会因为太多迁入和迁出活动而拖垮单个 poolboy 管理器。

怎样做?

使用简单的方法,启动多个池;随机迁出。maestro 需要了解每个池的工作流,当每个池都是同一类型的加载模式时,将会提升复杂性,降低性能,没有什么明显的优势。

使用:

MaestroName = many_pools,
Conf = [% maestro options
        {name, MaestroName},
        {pool_module, poolboy},
        {pool_count, 3},
        {use_named_pools, false},
        % poolboy options
        {worker_module, fabulous_worker},
        {size, 100},
        {max_overflow, 50}],
{ok, _} = maestro:start(Conf),
{SomePool, Worker1} = maestro:checkout(MaestroName),
thing_done = gen_server:call(Worker1, do_your_thing),
ok = maestro:pool_checkin(SomePool, Worker1),
also_done = maestro:transaction(
        MaestroName,
        fun (Worker) -> gen_server:call(Worker, do_your_other_thing) end),
ok = maestro:stop(MaestroName).

本文地址:https://codercto.com/soft/d/12455.html

Pragmatic Thinking and Learning

Pragmatic Thinking and Learning

Andy Hunt / The Pragmatic Bookshelf / 2008 / USD 34.95

In this title: together we'll journey together through bits of cognitive and neuroscience, learning and behavioral theory; you'll discover some surprising aspects of how our brains work; and, see how ......一起来看看 《Pragmatic Thinking and Learning》 这本书的介绍吧!

XML 在线格式化
XML 在线格式化

在线 XML 格式化压缩工具

RGB CMYK 转换工具
RGB CMYK 转换工具

RGB CMYK 互转工具

HEX HSV 转换工具
HEX HSV 转换工具

HEX HSV 互换工具