Beefy Boxes and Bandwidth Generously Provided by pair Networks
go ahead... be a heretic
 
PerlMonks  

comment on

( [id://3333]=superdoc: print w/replies, xml ) Need Help??

Well, I said I would be back if I had any news, so here I am.

I've decided to try and build an UDP communication system between my servers, and so far I haven't had any serious issues with this setup.

I chose this approach considering my specific situation, which might not aply to many others using any sorts of IPCs.

I have no need for persisting the queue items between application restarts, so I avoided the I/O activity caused by a file/database-based system. The servers are always on the same network, so UDP is just fine.

Although I think Corion's advice would probably be the most secure approach, it would also mean a lot of aditional work, such as having satellite servers depending on a single master for distributing the work to be done, or maybe set up another system just to elect a new master when the primary goes offline. Which would obviously set up a whole new level of complexity in the application.

So I just chose what I found out to be the most "cost-effective" solution: an ad-hoc, masterless system, where each servers asks (single tiny UDP datagram) its peers if they are working on the item which the server is about to enqueue. From the several runs that I've done, after many tweaks, I've seen duplicated processings at the average rate of 1 for each several thousands.

Since the main problem with duplicated processing, in my case, is the waste of CPU cycles for the servers doing twice the same job (no data loss, corruption or anything like that), it's perfectly fine for me.


In reply to Re^2: Sync item list between perl scripts, across servers by reinaldo.gomes
in thread Sync item list between perl scripts, across servers by reinaldo.gomes

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post; it's "PerlMonks-approved HTML":



  • Are you posting in the right place? Check out Where do I post X? to know for sure.
  • Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
    <code> <a> <b> <big> <blockquote> <br /> <dd> <dl> <dt> <em> <font> <h1> <h2> <h3> <h4> <h5> <h6> <hr /> <i> <li> <nbsp> <ol> <p> <small> <strike> <strong> <sub> <sup> <table> <td> <th> <tr> <tt> <u> <ul>
  • Snippets of code should be wrapped in <code> tags not <pre> tags. In fact, <pre> tags should generally be avoided. If they must be used, extreme care should be taken to ensure that their contents do not have long lines (<70 chars), in order to prevent horizontal scrolling (and possible janitor intervention).
  • Want more info? How to link or How to display code and escape characters are good places to start.
Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others perusing the Monastery: (3)
As of 2024-04-26 04:35 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found