Hi Doug and co,

I've written an Apache module I've called Apache::AppCluster that I
would like to propose for publication to CPAN in the Apache::*
namespace.

It allows one to use apache and mod_perl as a clustered/distrubited app
server spawning remote processes/requests in paralell. It allows you to
set up an object locally and then register 'requests' with it. Each
request is a function call (and data structure) that will be sent to a
remote apache/mod_perl app server via a POST (using freeze/thaw for
encoding) and will be executed on that server. The results are returned,
decoded and are accessable for each 'request' that was registered with
the object using an index. The client module can be used under mod_perl
or as standalone. The server component must run under mod_perl as a
handler for a <Location> and wont interfere with any other handlers.

The cool thing about this is (IMHO) that it uses non-blocking sockets to
send off all requests at the same time (well, almost - it sends them off
in rapid succession) so all processing on remote 'app servers' happens
simultaneously. Results are then collected simultaneously from all
sockets as they are received (loops through non-blocking sockets
collecting data until all is received or a timeout occurs). When
registering requests you specify the remote server and port for each
request so you can have 1000 remote methods being called on 100 seperate
app servers all processing at the same time and being consolidated on a
single front end server within a single object.

This was inspired by SOAP, but the difference is that every
implementation of SOAP I've come accross uses blocking sockets which is
a problem since thread support in Perl is not that great and you can't
really use fork() under mod_perl - or at least I've never had the guts
to try. So this allows you to do remote method calls on an app server in
parralel while still having a single thread of execution in the calling
process.

The reason I didn't just write a non-blocking version of SOAP is because
I want super fast performance, and I've found that SOAP is quite slow on
the client and server side. We're using this in-house as part of a web
service running  on a front end server (apache/mod_perl exposing a SOAP
API) that then spawns a bunch of processes on some back-end servers also
running apache/mod_perl using Apache::AppCluster.

I already have a PAUSE ID and would like to know if I may include this
in your namespace - and if there's anything out there like this already.
If this sounds useful, let me know and I'll package it up and either
upload it or send you the url for review.

thanks,

Mark Maunder.

Reply via email to