Jump to content

Recommended Posts

Hey everybody,

I have a more tricky situation here and maybe you can throw some ideas.

 

So, i have a site written in php that needs to communicate preaty intensive with a live server (on the same machine, written in Java), in order to get/set some resources, benefit from some real caching and persistence etc. I have several options for this, and I'm not sure what is best as performance.

 

1. Classic communication via sockets. This might be slow if i have a socket connect on every page. Maybe with a good setup i can benefit a performance boost from permanent connections.

 

2. RPC via SOAP or something else. I think this would be slower than sockets.

 

3. Shared memory communication (pipes?). At a first glance this looks to be the fastest alternative. I'm preaty new to shared memory communication in php, actually in general. I don't know what the connect overhead is but since it's not passing thought the whole tcp/ip protocol stack it should be way faster. The problems might be that the communication is not asynchronous or buffered which could cause big problems, and that the 2 communicator will have to stay on the same virtual machine. Plus, I'm not sure how i can send/receive more complex types of data, like arrays/maps. Maybe there are libraries to handle pipe communication more efficiently. Do you know any?

 

4. the php-java bridge http://php-java-bridge.sourceforge.net/ looks very nice and interesting and they say that the communication is 50 times faster than with rpc. however, i don't see how i can use it. it only allows me to instantiate java classes in php not communicate with an already started application. maybe if i run php inside a java servlet it could work, but i'm not sure it's the right thing to do since the java server should only be a tool not the main process.

 

What do you think it's the best choice, or do you know any other? I'm especially interested by performance, but i can't ignore scalability either.

Link to comment
https://forums.phpfreaks.com/topic/102117-php-communicating-with-java-server/
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.