php分布式任务系统,PHP中分布式系统的解剖

我有一个问题,给我一些困难的时间,试图找出理想的解决方案,为了更好地解释,我要揭露我的情况在这里。

I’ve a server that will receive orders

from several clients. Each client will

submit a set of recurring tasks that

should be executed at some specified

intervals, eg.: client A submits task

AA that should be executed every

minute between 2009-12-31 and

2010-12-31; so if my math is right

that’s about 525 600 operations in a

year, given more clients and tasks

it would be infeasible to let the server process all these tasks so I

came up with the idea of worker

machines. The server will be developed

on PHP.

Worker machines are just regular cheap

Windows-based computers that I’ll

host on my home or at my workplace,

each worker will have a dedicated

Internet connection (with dynamic IPs)

and a UPS to avoid power outages. Each

worker will also query the server every

30 seconds or so via web service calls,

fetch the next pending job and process it.

Once the job is completed the worker will

submit the output to the server and request

a new job and so on ad infinitum. If

there is a need to scale the system I

should just set up a new worker and the

whole thing should run seamlessly.

The worker client will be developed

in PHP or Python.

At any given time my clients should be

able to log on to the server and check

the status of the tasks they ordered.

现在这里是棘手的部分踢:

>我必须能够重建

已经处理的任务如果一些

原因服务器关闭。

>工人不是客户特定的,

一个工人应该处理工作

任何给定数量的客户端。

我对一般数据库设计和使用哪些技术有一些疑问。

最初我想到使用几个SQLite数据库,并在服务器上加入它们,但我不知道如何按客户端分组来生成工作报告。

我从来没有实际使用过以下任何技术:memcached,CouchDB,Hadoop和所有的类似,但我想知道这些是否适合我的问题,如果是的,你建议为新手是“分布式计算”(或者是这种平行?)像我一样。请记住,工人有动态IP。

像我之前说的,我也有一般的数据库设计的麻烦,部分是因为我还没有选择任何特定的R(D)DBMS,但一个问题,我已经,我认为它是不可知的DBMS我选择是相关的到排队系统…我应该预先计算所有绝对时间戳到一个特定的作业,并有一个大的时间戳集,执行和标记他们作为完成升序,或者我应该有一个更聪明的系统,如“当时间戳模数60 = = 0->执行“。这个“聪明”系统的问题是,一些工作不会被执行,因为他们应该是因为一些工人可以等待什么都不做,而其他工作负担过重。你建议什么?

PS:我不知道这个问题的标题和标签是否正确反映我的问题和我想做什么;如果没有请相应地编辑。

感谢您的输入!

@timdev:

>输入将是一个非常小的JSON编码字符串,输出也将是一个JSON enconded字符串,但有点大(在1-5 KB的顺序)。

>输出将使用Web中的几个可用资源进行计算,因此主要瓶颈可能是带宽。数据库写入也可以是一个 – 取决于R(D)DBMS。

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值