Would you please give me some idea about single client and multiple servers


 
Thread Tools Search this Thread
Top Forums Programming Would you please give me some idea about single client and multiple servers
# 1  
Old 03-12-2011
Would you please give me some idea about single client and multiple servers

Hi,

I have a program which needs to connect multiple servers at the same time. The program has to collect data from each of servers and then make a decision regarding to the data received.

There are several requirements.
1. Server (s) may shutdown anytime without any ack (e.g.power off).
2. Client has to connect several servers.
3. Every decision should "discuss" with servers; if one of them failed, the decision will based on others which still alive.
4. The discussion should be fast, more than 200ms is not acceptable.

My design principle is like that:
1. Create threads which every one connect to a server.
2. Creating a sending queue on each thread.
3. If the queue doesn't empty, then connect the server and send the data from queue to server.
4. Wait message from server.
5. Close the connection

There are also problems in the design.
1. If I sent the message to server, how about if the server dead and no response? (receive timeout?)
2. If we create and initiating socket in a short time, a lot of TIME_WAIT since the client will close the socket when send and receive operation finished.
3. Since I have to connect multiple servers, if one of them are failed. I have to reconnect them, may say every 1 second a try?

Would you please give me some ideas that how to handle such kind of application? Thanks a lot!
# 2  
Old 03-12-2011
TCP timeouts can take entire minutes. Best-effort delivery and all that.

I'd try a simpler system using UDP. The client sends a 'hello' to a bunch of servers via one packet each then does recvmsg() in a loop until 200 milliseconds are up. Any servers that answered in time get considered.

As an aside, that 200 milliseconds requirement isn't quite sane. Many people and services use connections that have a higher minimum latency than that. Anything that's actually busy and not idle could add latency too.
Login or Register to Ask a Question

Previous Thread | Next Thread

9 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

How to run simple single command on multiple Linux servers?

Hi All, How can i run a single command on multiple servers with or without giving credentials. I have a file(servers.txt) which has got list of servers and i want to run a command lsb_release -dr on all these servers and get output of those servers against each server. I tried below code... (9 Replies)
Discussion started by: darling
9 Replies

2. Shell Programming and Scripting

Require single command to start script in multiple servers

I have 9 servers, on each server a script with common name is available. I send a token file to all server from 1 particular server. so when a daemon job checks that token file is available then it triggers the script.. I want to know is there any command or script which I will run/execute on... (16 Replies)
Discussion started by: mirwasim
16 Replies

3. Shell Programming and Scripting

Multiple lines in a single column to be merged as a single line for a record

Hi, I have a requirement with, No~Dt~Notes 1~2011/08/1~"aaa bbb ccc ddd eee fff ggg hhh" Single column alone got splitted into multiple lines. I require the output as No~Dt~Notes 1~2011/08/1~"aaa<>bbb<>ccc<>ddd<>eee<>fff<>ggg<>hhh" mean to say those new lines to be... (1 Reply)
Discussion started by: Bhuvaneswari
1 Replies

4. Shell Programming and Scripting

How to give user name and password in a single command to login to remote server

Hello All, I'm new to unix and i need the below favour from you. I have list of 50 unix server. I need to login to all the server one by one and with the same user and password. I will declare the user name and password globally in the script. for example : servername- hyperV user name... (4 Replies)
Discussion started by: Hari A
4 Replies

5. HP-UX

Automatic execution of commands in multiple servers using single script.

Hi, I've to do a simple job many times whenever it has been asked, just i've to log in to all of fourtien HP servers and i've to execute ps -fu user > temp cat temp|sendmail "xyz@z.com" commands to send the statics of all of 14 servers over the mail to particular user id.. Though logging... (4 Replies)
Discussion started by: vickramshetty
4 Replies

6. SuSE

Regarding accessing multiple servers using single public ip address

Hello, Currently we are having different linux servers (for example: let's assume audio server, video server and text server) to handle requests from outside users. Suppose the outside users in different LAN (Local Area Network), other than the servers. For example user is in 20 series LAN and... (5 Replies)
Discussion started by: navneet_2009
5 Replies

7. UNIX for Advanced & Expert Users

How to give FTP access to a single user

Hi all, How can i give ftp access to single user on solaris9 system? others should not have the ftp access. i know about ftpusers file in /etc/ftpd but still what about if so many new users are created daily? And now for that single user how can we restict him to ftp the files only from... (2 Replies)
Discussion started by: santhoshkumar_d
2 Replies

8. Shell Programming and Scripting

need some help...can any body give some idea

Hi i need some help... 1.i have one main folder XYZ. 2.Many folders inside xyz say abc,def,mno 3.And inside each folder, i have many files . want to print what ever files are present inside the subfolder abc,def,mno (what ever todays file ) in output file.out put file should be in xyz(say... (13 Replies)
Discussion started by: sapan123
13 Replies

9. UNIX for Advanced & Expert Users

can any body give some idea on this..

create one script That reads a file <file> Each line of <file> file contains just an account The run the grep command like below /usr/xpg4/bin/grep -E -e 'ACCOUNT.*' < File> > <OUTPUT FILE> (1 Reply)
Discussion started by: sapan123
1 Replies
Login or Register to Ask a Question