Re: updated load balancing qmail-qmqpc.c mods

2000-08-09 Thread Bruno Wolff III
On Wed, Aug 02, 2000 at 05:08:28PM +, JuanE [EMAIL PROTECTED] wrote: I did not think of that. Good suggestion. It seems like it would be a good compropmise if you can take your down server out of the rotation relatively quickly. If not, then you'll waste considerable time polling

Re: updated load balancing qmail-qmqpc.c mods

2000-08-09 Thread David Dyer-Bennet
Bruno Wolff III [EMAIL PROTECTED] writes on 9 August 2000 at 09:12:29 -0500 On Wed, Aug 02, 2000 at 05:08:28PM +, JuanE [EMAIL PROTECTED] wrote: I did not think of that. Good suggestion. It seems like it would be a good compropmise if you can take your down server out

Re: updated load balancing qmail-qmqpc.c mods

2000-08-03 Thread Pavel Kankovsky
On 2 Aug 2000, Frank D. Cringle wrote: Generating a random permutation algorithmically is not too easy. Oh really? int i, j, x; int a[N]; for (i = 0; i N; ++i) a[i] = i; for (i = N - 1; i 0; --i) { j = random(i); x = a[i]; a[i] = a[j]; a[j] = x; } where random(i) is

Re: updated load balancing qmail-qmqpc.c mods

2000-08-03 Thread Frank D. Cringle
Pavel Kankovsky [EMAIL PROTECTED] writes: On 2 Aug 2000, Frank D. Cringle wrote: Generating a random permutation algorithmically is not too easy. Oh really? [ swap each element with a randomly chosen partner ] Yes, that will do it. When I was originally working with this stuff the

Re: updated load balancing qmail-qmqpc.c mods

2000-08-02 Thread Frank D. Cringle
"Austad, Jay" [EMAIL PROTECTED] writes: From: JuanE [mailto:[EMAIL PROTECTED]] Assume you have 4 servers A, B, C, D, and that server C is down. When your random seed hits server A, B or D (with probability 1/4, respectively) the message will go through fine. When your random seeds hits server

Re: updated load balancing qmail-qmqpc.c mods

2000-08-02 Thread JuanE
the dead one, and give everything an even chance again. Jay -Original Message- From: JuanE [mailto:[EMAIL PROTECTED]] Sent: Tuesday, August 01, 2000 6:57 PM To: [EMAIL PROTECTED] Subject: Re: updated load balancing qmail-qmqpc.c mods Jay, If I understand this correctly

Re: updated load balancing qmail-qmqpc.c mods

2000-08-02 Thread JuanE
I like the idea of statically listing them, but as you mentioned it is not very scalable. The shuffling can be very expensive. I believe it would grow with N^2. Instead of shuffling, just plain random sampling would be better computationally. See me previous posting. I think this is a "profile,

Re: updated load balancing qmail-qmqpc.c mods

2000-08-02 Thread Michael T. Babcock
Re-read my point: its unnecessary. I didn't say it wouldn't work. I said the CPU use of doing it this way was unnecessary over a simpler round-robin approach (After picking an initial random server). Note: I think using an array of pointers to server addresses would allow you to do your

RE: updated load balancing qmail-qmqpc.c mods

2000-08-02 Thread Austad, Jay
I agree with you, I forgot to mention that, sorry. I didn't have enough Mountain Dew yet. :) -Original Message- From: Michael T. Babcock [mailto:[EMAIL PROTECTED]] Sent: Wednesday, August 02, 2000 10:44 AM To: Austad, Jay; [EMAIL PROTECTED] Subject: Re: updated load balancing qmail

Re: updated load balancing qmail-qmqpc.c mods

2000-08-02 Thread JuanE
- From: Michael T. Babcock [mailto:[EMAIL PROTECTED]] Sent: Wednesday, August 02, 2000 10:44 AM To: Austad, Jay; [EMAIL PROTECTED] Subject: Re: updated load balancing qmail-qmqpc.c mods Re-read my point: its unnecessary. I didn't say it wouldn't work. I said the CPU use of doing

Re: updated load balancing qmail-qmqpc.c mods

2000-08-02 Thread JuanE
David Dyer-Bennet writes: JuanE [EMAIL PROTECTED] writes on 2 August 2000 at 16:37:36 GMT I agree with you both (Jay and Michael), at least partially. I agree that altough what Jay proposes will work, it is too much computation and that a simpler round-robin (after picking initial

Re: updated load balancing qmail-qmqpc.c mods

2000-08-02 Thread Michael T. Babcock
: "JuanE" [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Wednesday, August 02, 2000 12:37 PM Subject: Re: updated load balancing qmail-qmqpc.c mods I agree with you both (Jay and Michael), at least partially. I agree that altough what Jay proposes will work, it is too much c

updated load balancing qmail-qmqpc.c mods

2000-08-01 Thread Austad, Jay
Ok, I fixed it. It now just rotates the serverindex.pos[] by a random amount, and then loops through until it finds a good server. rand() is still seeded with milliseconds from the system clock. I used memcpy() to move the array around instead of loops to make it more efficient. Would it be