Project Help Wanted
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsOtherProject Help Wanted

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old June 30th, 2004, 02:42 AM
Rooseboom's Avatar
Rooseboom Rooseboom is offline
PHP isn't intended for that???
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Nov 2001
Location: Amersfoort, Netherlands
Posts: 252 Rooseboom User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 22 h 56 m 36 sec
Reputation Power: 7
Question linux socket server + merging in a forked process

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

Reply With Quote
  #2  
Old June 30th, 2004, 02:53 PM
infinitylimit infinitylimit is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: May 2004
Posts: 72 infinitylimit User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 8 h 13 m 59 sec
Reputation Power: 5
Send a message via Yahoo to infinitylimit
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...

Reply With Quote
  #3  
Old July 1st, 2004, 12:57 AM
Rooseboom's Avatar
Rooseboom Rooseboom is offline
PHP isn't intended for that???
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Nov 2001
Location: Amersfoort, Netherlands
Posts: 252 Rooseboom User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 22 h 56 m 36 sec
Reputation Power: 7
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.

Reply With Quote
Reply

Viewing: Dev Shed ForumsOtherProject Help Wanted > linux socket server + merging in a forked process


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 4 hosted by Hostway