[Chicago-talk] Design Question

JT Smith jt at plainblack.com
Fri May 6 09:12:40 PDT 2005


> I plan to have it running on 10 eventually.  Will
> having 10 machines constantly querying the database
> server
> several times per second damage the server?  What is a

I wouldn't say it would "damage" it, but you'll certainly make it very busy, and I think 
unneccesarily so.

> safe level of activity?  Does anyone know of a more
> efficient way of designing such a program?

Polling systems are insanely inefficient, but sometimes they're the only way to get the 
job done. In this case I think you have a much better way of doing it:

Set up an event handler server, I recommend using POE to write this, but you can 
certainly write your own. The perl script on your PBX can kick off an event to the event 
handler server each time a new call comes in. The event handler server can do whatever 
processing you need done (writing to the database, analyzing numbers for duplicates, 
etc). This way you never have to poll the database and you can handle a much larger 
number of calls and other processes.

One key to using an event handler like this is that it's an asynchronos process, 
therefore it can theoretically handle an unlimited number of transactions because as new 
transactions come in their placed on a queue and wait to be processed until the event 
handler server has time to deal with them.


JT ~ Plain Black
ph: 703-286-2525 ext. 810
fax: 312-264-5382
http://www.plainblack.com

Create like a god, command like a king, work like a slave.


More information about the Chicago-talk mailing list