Theo Kouzelis
Theo Kouzelis

Reputation: 3523

Best Protocol for a App to Use a Service on the Same Server?

I have a PHP app that needs to talk to a service which has a API that produces XML responses to HTTP requests. If this service was on a separate server I would normally use a HTTP client like Guzzle to create and consume, requests and responses.

But my service will be (for the time being) on the same server. In this scenario is making HTTP requests in this fashion still my best option? Will all my requests to the API leave the server which will add latency which could be avoided?

Upvotes: 3

Views: 71

Answers (1)

wkstar
wkstar

Reputation: 265

Yes - use Guzzle/HTTP. If you need to scale later you'll be able to take advantage of the network easily. Latency won't be an issue - the traffic won't leave the box.

Upvotes: 2

Related Questions