|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
||||
|
||||
|
Hi,
I need a module build for my project. This project is written in PHP and the module I need can't be build in PHP. Since my C++ (and such) skills aren't all that (read: none) so I thought: "let's ask here". So what should this module do? In short: be a socketserver, send request to several other servers, use a sort on the returned answer and send it back to the original requesting server. Below I have written out the whole process from one server to the other. The so called MergeServer is what the module beholds. 1) WebServer sends a request to the MergeServer by opening a socketconnection on port x (port for socketserver on MergeServer set in a configurationfile). The request is a string with variable length like: 23,2365,345. 2) MergeServer receives the request and passes this through to all available IndexServers (minimum of 1, maximum of 10 IndexServers) in a parallel manner, not serial. The MergeServer waits a maximum of 1,5 secondes (time can be set in a configurationfile in milliseconds) for answers. The IndexServers operate as a webserver receiving requests on port 80. The availability of the IndexServers is set in a configurationfile with an ip-address and status set in it, one per newline. Like: 192.168.1.2;1 where after the ; the status is held with 1 being available, 0 being unavailable. 3) Every IndexServer sends its result from the received original string (23,2365,345 in this case) back to the MergeServer. The result sent back is again in stringformat with variable length, like: 1435,3455;50012434,234;3467,5623 etc (being three blocks in this case). 4) After the MergeServer has received all the response from all available IndexServers (or they have timed out), the MergeServer will sort (DESC) the total resonses received based on the second part of every block (blocks are indicated by a ; ). In this case 5623 over 3455 and 3455 over 234. The first 200 (number can be set in a configurationfile) first part of the sorted blocks will be send back to the WebServer. In this case: 3467,1435,50012434 (it will be send in this way as a string) That's it. That's the whole process around the MergeServer. There are some 'rules': - The MergeServer should be able to serve 10 concurrent request from the WebServer (peeks being up to 25 concurrent requests). Keeping in mind that there can be up to 10 IndexServers to which the request is send next. - The MergeServer should run on a linux machine (probably RedHat). Being the only thing that machine has to do. The linux machine will have specs like an Intel or AMD 3 GHz CPU, 2 GB RAM and sufficient disk and an 1 Gbit networkpipe. Now for my request to any of you: can someone build this for me? If so, what do you want for it? I'll be needing the source-code as well (being reviewed). Thx.
__________________
TOO BUSY |
|
#2
|
|||
|
|||
|
Hey have you looked at
http://us2.php.net/manual/en/function.fsockopen.php ? this allows socket connections in php. This is how you handle paypal... |
|
#3
|
||||
|
||||
|
Sockets aren't the problem, nor the creation of a socketserver in PHP, the forking (multithreading) of processes and the heavy load (stability) makes PHP unsuited.
And what has PayPal got to do with it? Last edited by Rooseboom : July 1st, 2004 at 02:27 AM. |
![]() |
| Viewing: Dev Shed Forums > Other > Project Help Wanted > linux socket server + merging in a forked process |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|