How can I turn a big chunk of native code into a scalable service?

168 views Asked by At

Greetings, I have a large piece of software developed in Eiffel. It is possible to use this code from C++, but it loads Eiffel runtime, and I can't trust the Eiffel code and runtime to be thread safe, when accessed by multiple threads from C++

I need to turn this native code into a service, but I would like to scale to multiple servers in case of high load. I don't want to delegate the scaling aspect to Eiffel code & runtime, so I'm looking into wrapping this code with existing scalability options.

Is there anything under Apache web server that'd let me provide thread safe access to this chunk of code? How about a pool of Eiffel code instances? What I have in mind is something like this:

[lots of client requests over network] ---> [Some scalable framework] --> [One or more instances of expensive to create Eiffel code]

I'd like the framework to let me wrap multiple instances of expensive chunks of code and I'd like to scale this up just like a web farm, by adding more machines.

Best Regards

Seref

1

There are 1 answers

0
Fred Foo On BEST ANSWER

If you're not tied to Apache but any other framework would suffice, I suggest you check out the ZeroMQ message passing framework. Its ZMQ_PUSH/ZMQ_PULL model with zmq_tcp transport seems to do what you want.

Your setup would be something like: one "master" process servicing outside requests (in any language/platform, perhaps an Apache mod) and a runtime-configurable number of C++ worker processes that call into Eiffel code and push results back.